1 Reply Latest reply on Jun 15, 2005 1:19 AM by Bela Ban

    Fqn.equals() is broken

    Brian Dueck Newbie

      Bela;

      I'm sorry to say that I forwarded you some bad mojo code that was supposed to improve the efficiency of Fqn.equals() but ended up breaking it altogether. As you can see from the patch below, it fundamentally breaks equals...

      Apologies,

      Brian.


      Index: Fqn.java
      ===================================================================
      RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Fqn.java,v
      retrieving revision 1.8
      diff -u -r1.8 Fqn.java
      --- Fqn.java 14 Jun 2005 03:25:19 -0000 1.8
      +++ Fqn.java 14 Jun 2005 19:10:26 -0000
      @@ -137,7 +137,7 @@
       if(obj == null)
       return false;
       other=(Fqn)obj; // might throw a ClassCastException
      - if (obj == other)
      + if (this == other)
       return true;
       if(other.size() != (len=size()))
       return false;