You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by fu...@apache.org on 2006/04/27 07:19:17 UTC
svn commit: r397402 -
/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java
Author: fuzzylogic
Date: Wed Apr 26 22:19:14 2006
New Revision: 397402
URL: http://svn.apache.org/viewcvs?rev=397402&view=rev
Log:
DERBY-1174: Avoid NPE in JNDIAuthenticationSchemeBase if dbProps is null.
Merge of 395525 from trunk.
Modified:
db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java
Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java?rev=397402&r1=397401&r2=397402&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java (original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/jdbc/authentication/JNDIAuthenticationSchemeBase.java Wed Apr 26 22:19:14 2006
@@ -97,16 +97,19 @@
//
// We retrieve JNDI properties set at the database level
- // if any.
+ // if any. If dbProps == null, there are obviously no database
+ // properties to retrieve.
//
initDirContextEnv = new Properties();
+
+ if(dbProps != null) {
+ for (Enumeration keys = dbProps.propertyNames(); keys.hasMoreElements(); ) {
- for (Enumeration keys = dbProps.propertyNames(); keys.hasMoreElements(); ) {
+ String key = (String) keys.nextElement();
- String key = (String) keys.nextElement();
-
- if (key.startsWith("java.naming.")) {
- initDirContextEnv.put(key, dbProps.getProperty(key));
+ if (key.startsWith("java.naming.")) {
+ initDirContextEnv.put(key, dbProps.getProperty(key));
+ }
}
}
}