You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ha...@apache.org on 2012/06/29 23:30:20 UTC
svn commit: r1355567 -
/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
Author: hadrian
Date: Fri Jun 29 21:30:19 2012
New Revision: 1355567
URL: http://svn.apache.org/viewvc?rev=1355567&view=rev
Log:
Fix equals() to account for null and other Object types
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java?rev=1355567&r1=1355566&r2=1355567&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java Fri Jun 29 21:30:19 2012
@@ -58,9 +58,11 @@ public final class MappedEndpointConfigu
@Override
public boolean equals(Object other) {
+ if (other == null || !(other instanceof MappedEndpointConfiguration)) {
+ return false;
+ }
// if all parameters including scheme are the same, the component and uri must be the same too
- boolean eq = params.equals(((MappedEndpointConfiguration)other).params);
- return this == other || (this.getClass() == other.getClass() && eq);
+ return this == other || (this.getClass() == other.getClass() && params.equals(((MappedEndpointConfiguration)other).params));
}
@Override