cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r687666 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java
Date Thu, 21 Aug 2008 09:33:00 GMT
Author: aadamchik
Date: Thu Aug 21 02:32:59 2008
New Revision: 687666

URL: http://svn.apache.org/viewvc?rev=687666&view=rev
Log:
fixing DN NPE

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java?rev=687666&r1=687665&r2=687666&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/conf/DriverDataSourceFactory.java
Thu Aug 21 02:32:59 2008
@@ -313,6 +313,10 @@
             String password = atts.getValue("password");
             String passwordLocation = atts.getValue("passwordLocation");
             String passwordSource = atts.getValue("passwordSource");
+            if(passwordSource == null) {
+                passwordSource = DataSourceInfo.PASSWORD_LOCATION_MODEL;
+            }
+            
             String username = atts.getValue("userName");
 
             driverInfo.setPasswordEncoderClass(encoderClass);
@@ -329,11 +333,10 @@
 
             PasswordEncoding passwordEncoder = driverInfo.getPasswordEncoder();
 
-            if (passwordLocation != null) // New style model (v1.2), process extra
-            // locations
-            {
+            if (passwordLocation != null) {
                 if (passwordLocation.equals(DataSourceInfo.PASSWORD_LOCATION_CLASSPATH))
{
-                    URL url = parentConfiguration.getResourceFinder().getResource(passwordLocation);
+                    URL url = parentConfiguration.getResourceFinder().getResource(
+                            passwordLocation);
 
                     if (url != null)
                         password = passwordFromURL(url);



Mime
View raw message