Better error message for bad properties on jndi data connector.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 18 Nov 2004 17:03:07 +0000 (17:03 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 18 Nov 2004 17:03:07 +0000 (17:03 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1192 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/JNDIDirectoryDataConnector.java

index bcd99ee..ea3f831 100644 (file)
@@ -120,13 +120,19 @@ public class JNDIDirectoryDataConnector extends BaseDataConnector implements Dat
                        String propName = property.getAttribute("name");
                        String propValue = property.getAttribute("value");
 
-                       if (propName != null && !propName.equals("") && propValue != null && !propValue.equals("")) {
-                               properties.setProperty(propName, propValue);
-                               log.debug("Property: (" + propName + ").");
-                               log.debug("   Value: (" + propValue + ").");
-                       } else {
+                       log.debug("Property: (" + propName + ").");
+                       log.debug("   Value: (" + propValue + ").");
+
+                       if (propName == null || propName.equals("")) {
                                log.error("Property is malformed.");
-                               throw new ResolutionPlugInException("Property is malformed.");
+                               throw new ResolutionPlugInException("Property (" + propName
+                                               + ") is malformed.  Connot accept empty property name.");
+                       } else if (propValue == null || propValue.equals("")) {
+                               log.error("Property is malformed.");
+                               throw new ResolutionPlugInException("Property (" + propName
+                                               + ") is malformed.  Cannot accept empty property value.");
+                       } else {
+                               properties.setProperty(propName, propValue);
                        }
                }