commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-commons/dbutils/src/java/org/apache/commons/dbutils BeanProcessor.java
Date Thu, 02 Sep 2004 02:51:40 GMT
dgraham     2004/09/01 19:51:40

  Modified:    dbutils/src/java/org/apache/commons/dbutils
                        BeanProcessor.java
  Log:
  Fill array with PROPERTY_NOT_FOUND in mapColumnsToProperties() instead of
  setting it multiple times within the for loop.  This gives us a small performance
  improvement and makes the logic clearer.
  
  Revision  Changes    Path
  1.5       +2 -3      jakarta-commons/dbutils/src/java/org/apache/commons/dbutils/BeanProcessor.java
  
  Index: BeanProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbutils/src/java/org/apache/commons/dbutils/BeanProcessor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BeanProcessor.java	23 Aug 2004 02:07:36 -0000	1.4
  +++ BeanProcessor.java	2 Sep 2004 02:51:40 -0000	1.5
  @@ -27,6 +27,7 @@
   import java.sql.SQLException;
   import java.sql.Timestamp;
   import java.util.ArrayList;
  +import java.util.Arrays;
   import java.util.HashMap;
   import java.util.List;
   import java.util.Map;
  @@ -363,6 +364,7 @@
   
           int cols = rsmd.getColumnCount();
           int columnToProperty[] = new int[cols + 1];
  +        Arrays.fill(columnToProperty, PROPERTY_NOT_FOUND);
   
           for (int col = 1; col <= cols; col++) {
               String columnName = rsmd.getColumnName(col);
  @@ -371,9 +373,6 @@
                   if (columnName.equalsIgnoreCase(props[i].getName())) {
                       columnToProperty[col] = i;
                       break;
  -
  -                } else {
  -                    columnToProperty[col] = PROPERTY_NOT_FOUND;
                   }
               }
           }
  
  
  

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


Mime
View raw message