[hornetq-commits] JBoss hornetq SVN: r10595 - in trunk/hornetq-core/src/main/java/org/hornetq/core: journal and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu May 5 13:20:21 EDT 2011


Author: borges
Date: 2011-05-05 13:20:21 -0400 (Thu, 05 May 2011)
New Revision: 10595

Modified:
   trunk/hornetq-core/src/main/java/org/hornetq/core/filter/impl/Identifier.java
   trunk/hornetq-core/src/main/java/org/hornetq/core/journal/RecordInfo.java
Log:
Fix: .equals() didn't check for null argument

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/filter/impl/Identifier.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/filter/impl/Identifier.java	2011-05-05 17:19:40 UTC (rev 10594)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/filter/impl/Identifier.java	2011-05-05 17:20:21 UTC (rev 10595)
@@ -38,9 +38,10 @@
 {
    private final SimpleString name;
 
+   private final int hash;
+
    private Object value;
 
-   private final int hash;
 
    public Identifier(final SimpleString name)
    {
@@ -60,7 +61,7 @@
    @Override
    public boolean equals(final Object obj)
    {
-      if (obj.getClass() != Identifier.class)
+      if (!(obj instanceof Identifier))
       {
          return false;
       }

Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/journal/RecordInfo.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/journal/RecordInfo.java	2011-05-05 17:19:40 UTC (rev 10594)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/journal/RecordInfo.java	2011-05-05 17:20:21 UTC (rev 10595)
@@ -63,6 +63,10 @@
    @Override
    public boolean equals(final Object other)
    {
+	  if (!(other instanceof RecordInfo))
+	  {
+		   return false;
+      }
       RecordInfo r = (RecordInfo)other;
 
       return r.id == id;



More information about the hornetq-commits mailing list