Ignore:
Timestamp:
07/11/14 11:58:34 (10 years ago)
Author:
pharms
Message:
  • equals check for SOAP events
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/HTTPEventType.java

    r1561 r1599  
    136136            HTTPEventType other = (HTTPEventType) obj; 
    137137             
     138            if (!other.getClass().isAssignableFrom(this.getClass())) { 
     139                return false; 
     140            } 
     141             
     142            if (exchange == null) { 
     143                return other.exchange == null; 
     144            } 
     145            else if (other.exchange == null) { 
     146                return false; 
     147            } 
     148             
    138149            HttpRequest request1 = exchange.getRequest(); 
    139150            HttpRequest request2 = other.exchange.getRequest(); 
    140151             
    141             return (HTTPUtils.equals(exchange.getSender(), other.exchange.getSender()) && 
    142                     HTTPUtils.equals(exchange.getReceiver(), other.exchange.getReceiver()) && 
     152            // do not compare the sender, as this may change 
     153            return (HTTPUtils.equals(exchange.getReceiver(), other.exchange.getReceiver()) && 
    143154                    HTTPUtils.equals(request1.getMethod(), request2.getMethod()) && 
    144155                    HTTPUtils.equals(request1.getProtocol(), request2.getProtocol()) && 
     
    155166    @Override 
    156167    public int hashCode() { 
    157         return 
    158             exchange.getRequest().getMethod().hashCode() + 
    159             exchange.getRequest().getProtocol().hashCode() + 
    160             exchange.getRequest().getUrl().hashCode(); 
     168        if (exchange != null) { 
     169            return 
     170                exchange.getRequest().getMethod().hashCode() + 
     171                exchange.getRequest().getProtocol().hashCode() + 
     172                exchange.getRequest().getUrl().hashCode(); 
     173        } 
     174        else { 
     175            return 0; 
     176        } 
    161177    } 
    162178 
Note: See TracChangeset for help on using the changeset viewer.