Fixed a small bug where value handler was being set repeatedly.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 22 Jul 2003 19:19:19 +0000 (19:19 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 22 Jul 2003 19:19:19 +0000 (19:19 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@685 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

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

index a39cd41..60c6aa5 100644 (file)
@@ -175,14 +175,15 @@ public class SimpleAttributeDefinition extends BaseAttributeDefinition implement
                        attribute.setLifetime(lifeTime);
                }
 
+               if (smartScope != null) {
+                       attribute.registerValueHandler(new ScopedStringValueHandler(smartScope));
+               }
+               if (smartScope == null && valueHandler != null) {
+                       attribute.registerValueHandler(valueHandler);
+               }
+               
                Iterator resultsIt = results.iterator();
                while (resultsIt.hasNext()) {
-                       if (smartScope != null) {
-                               attribute.registerValueHandler(new ScopedStringValueHandler(smartScope));
-                       }
-                       if (smartScope == null && valueHandler != null) {
-                               attribute.registerValueHandler(valueHandler);
-                       }
                        attribute.addValue(resultsIt.next());
                }
                attribute.setResolved();