db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker PBKey.java
Date Fri, 27 Feb 2004 18:31:29 GMT
brj         2004/02/27 10:31:29

  Modified:    src/java/org/apache/ojb/broker PBKey.java
  Log:
  fixed minor problems detected by findbugs
  
  Revision  Changes    Path
  1.8       +10 -5     db-ojb/src/java/org/apache/ojb/broker/PBKey.java
  
  Index: PBKey.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/PBKey.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PBKey.java	7 Jan 2004 11:41:20 -0000	1.7
  +++ PBKey.java	27 Feb 2004 18:31:29 -0000	1.8
  @@ -41,11 +41,16 @@
   
       public boolean equals(Object obj)
       {
  -        if(obj != null && obj instanceof PBKey)
  +        if (obj == this)
           {
  -            return this.hashCode() == obj.hashCode();
  +            return true;
           }
  -        return false;
  +        if (!(obj instanceof PBKey))
  +        {
  +            return false;
  +        }
  +
  +        return this.hashCode() == obj.hashCode();
       }
   
       /**
  @@ -64,7 +69,7 @@
       {
           if(hashCode == 0)
           {
  -            hashCode = new String("" + this.jcdAlias + this.user + this.password).hashCode();
  +            hashCode = new String(this.jcdAlias + this.user + this.password).hashCode();
           }
           return hashCode;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message