db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/singlevm PersistenceBrokerImpl.java
Date Mon, 30 Dec 2002 15:59:29 GMT
brj         2002/12/30 07:59:29

  Modified:    src/java/org/apache/ojb/broker/singlevm
                        PersistenceBrokerImpl.java
  Log:
  fixed problem with inner class Key
  
  Revision  Changes    Path
  1.99      +18 -2     jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java
  
  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/singlevm/PersistenceBrokerImpl.java,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- PersistenceBrokerImpl.java	28 Dec 2002 11:28:01 -0000	1.98
  +++ PersistenceBrokerImpl.java	30 Dec 2002 15:59:28 -0000	1.99
  @@ -2541,6 +2541,7 @@
   // ************************************************************************
   // inner class
   // ************************************************************************
  + 
       /**
        * This is a helper class to model a Key of an Object
        */
  @@ -2550,7 +2551,22 @@
   
           Key(Object[] aKey)
           {
  -            m_key = aKey;
  +            m_key = new Object[aKey.length];
  +            
  +            for (int i = 0; i < aKey.length; i++)
  +            {
  +                // BRJ:
  +                // convert all Numbers to Long to simplify equals
  +                // could lead to problems when Floats are used as key
  +                if (aKey[i] instanceof Number)
  +                {
  +                    m_key[i] = new Long(((Number)aKey[i]).longValue());
  +                }
  +                else
  +                {
  +                    m_key[i] = aKey[i];
  +                }
  +            }
           }
   
           public boolean equals(Object otherKey)
  
  
  

Mime
View raw message