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/metadata DescriptorRepository.java
Date Thu, 23 Dec 2004 22:22:00 GMT
brj         2004/12/23 14:22:00

  Modified:    src/java/org/apache/ojb/broker/metadata/fieldaccess
                        AnonymousPersistentFieldHelper.java
               src/java/org/apache/ojb/broker/metadata
                        DescriptorRepository.java
  Log:
  problems detected by findbugs
  
  Revision  Changes    Path
  1.9       +4 -4      db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/AnonymousPersistentFieldHelper.java
  
  Index: AnonymousPersistentFieldHelper.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/AnonymousPersistentFieldHelper.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AnonymousPersistentFieldHelper.java	5 Jul 2004 08:37:41 -0000	1.8
  +++ AnonymousPersistentFieldHelper.java	23 Dec 2004 22:21:59 -0000	1.9
  @@ -38,10 +38,10 @@
       {
           Map descriptorTable = repository.getDescriptorTable();
           final String OBJECT = Object.class.getName();
  -        for (Iterator iter = descriptorTable.keySet().iterator(); iter.hasNext();)
  +        for (Iterator iter = descriptorTable.entrySet().iterator(); iter.hasNext();)
           {
  -            String key = (String) iter.next();
  -            ClassDescriptor cld = (ClassDescriptor) descriptorTable.get(key);
  +            Map.Entry me = (Map.Entry) iter.next();
  +            ClassDescriptor cld = (ClassDescriptor) me.getValue();
               String baseClass = cld.getBaseClass();
               if (null != baseClass)
               {
  
  
  
  1.59      +6 -7      db-ojb/src/java/org/apache/ojb/broker/metadata/DescriptorRepository.java
  
  Index: DescriptorRepository.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/DescriptorRepository.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- DescriptorRepository.java	4 Dec 2004 12:04:22 -0000	1.58
  +++ DescriptorRepository.java	23 Dec 2004 22:22:00 -0000	1.59
  @@ -569,16 +569,15 @@
        */
       public String toString()
       {
  -        Map temp = (Map)descriptorTable.clone();
  -        Iterator itKey = temp.keySet().iterator();
  +        Iterator it = descriptorTable.entrySet().iterator();
           ToStringBuilder buf = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
           String className = "class name: ";
           String tableName = "> table name: ";
  -        while (itKey.hasNext())
  +        while (it.hasNext())
           {
  -            Object cl = itKey.next();
  -            ClassDescriptor descriptor = (ClassDescriptor) temp.get(cl);
  -            buf.append(className + cl.toString() + " =", tableName + descriptor.getFullTableName());
  +            Map.Entry me = (Map.Entry) it.next();
  +            ClassDescriptor descriptor = (ClassDescriptor) me.getValue();
  +            buf.append(className + me.getKey() + " =", tableName + descriptor.getFullTableName());
           }
           return buf.toString();
       }
  
  
  

---------------------------------------------------------------------
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