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));
+ }
}
}
}
|