Changeset 1599 for trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/HTTPEventType.java
- Timestamp:
- 07/11/14 11:58:34 (10 years ago)
- 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 136 136 HTTPEventType other = (HTTPEventType) obj; 137 137 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 138 149 HttpRequest request1 = exchange.getRequest(); 139 150 HttpRequest request2 = other.exchange.getRequest(); 140 151 141 return (HTTPUtils.equals(exchange.getSender(), other.exchange.getSender()) &&142 152 // do not compare the sender, as this may change 153 return (HTTPUtils.equals(exchange.getReceiver(), other.exchange.getReceiver()) && 143 154 HTTPUtils.equals(request1.getMethod(), request2.getMethod()) && 144 155 HTTPUtils.equals(request1.getProtocol(), request2.getProtocol()) && … … 155 166 @Override 156 167 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 } 161 177 } 162 178
Note: See TracChangeset
for help on using the changeset viewer.