db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject cvs commit: db-torque/src/java/org/apache/torque/dsfactory AbstractDataSourceFactory.java
Date Sun, 19 Dec 2004 12:06:17 GMT
tfischer    2004/12/19 04:06:17

  Modified:    src/java/org/apache/torque/dsfactory Tag: TORQUE_3_1_BRANCH
                        AbstractDataSourceFactory.java
  Log:
  Do not log value of the password property when initializing the data source
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.12.2.4  +33 -13    db-torque/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java
  
  Index: AbstractDataSourceFactory.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/dsfactory/AbstractDataSourceFactory.java,v
  retrieving revision 1.12.2.3
  retrieving revision 1.12.2.4
  diff -u -r1.12.2.3 -r1.12.2.4
  --- AbstractDataSourceFactory.java	13 Dec 2004 17:08:27 -0000	1.12.2.3
  +++ AbstractDataSourceFactory.java	19 Dec 2004 12:06:17 -0000	1.12.2.4
  @@ -120,19 +120,39 @@
               }
               else
               {
  -                Class propertyType =
  -                    PropertyUtils.getPropertyType(ds, property);
  -                Object value =
  -                    ConvertUtils.convert(c.getString(property), propertyType);
  -                PropertyUtils.setSimpleProperty(ds, property, value);
  -
  -                if (log.isDebugEnabled())
  +                if ("password".equals(key)) 
                   {
  -                    log.debug("setSimpleProperty("
  -                                   + ds + ", "
  -                                   + property + ", "
  -                                   + value
  -                                   + ")");
  +                    // do not log value of password
  +                    // for this, ConvertUtils.convert cannot be used
  +                    // as it also logs the value of the converted property
  +                    // so it is assumed here that the password is a String
  +                    String value = c.getString(property);
  +                    PropertyUtils.setSimpleProperty(ds, property, value);
  +                    if (log.isDebugEnabled())
  +                    {
  +                        log.debug("setSimpleProperty("
  +                                       + ds + ", "
  +                                       + property + ", "
  +                                       + " (value not logged)"
  +                                       + ")");
  +                    }
  +                }
  +                else
  +                {
  +                    Class propertyType =
  +                        PropertyUtils.getPropertyType(ds, property);
  +                    Object value =
  +                        ConvertUtils.convert(c.getString(property), propertyType);
  +                    PropertyUtils.setSimpleProperty(ds, property, value);
  +    
  +                    if (log.isDebugEnabled())
  +                    {
  +                        log.debug("setSimpleProperty("
  +                                       + ds + ", "
  +                                       + property + ", "
  +                                       + value
  +                                       + ")");
  +                    }
                   }
               }
           }
  
  
  

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


Mime
View raw message