portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r745126 - /portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/model/impl/AttributeImpl.java
Date Tue, 17 Feb 2009 15:47:35 GMT
Author: vkumar
Date: Tue Feb 17 15:47:34 2009
New Revision: 745126

URL: http://svn.apache.org/viewvc?rev=745126&view=rev
Log:
Improvement in getValues of Attribute.

In-case of single value attribute, code will return list with single value, if getValues get
called on Attribute

Modified:
    portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/model/impl/AttributeImpl.java

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/model/impl/AttributeImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/model/impl/AttributeImpl.java?rev=745126&r1=745125&r2=745126&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/model/impl/AttributeImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.2-PRE-PLUTO-2-SNAPSHOT/components/jetspeed-security/src/main/java/org/apache/jetspeed/security/mapping/model/impl/AttributeImpl.java
Tue Feb 17 15:47:34 2009
@@ -17,7 +17,9 @@
 package org.apache.jetspeed.security.mapping.model.impl;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 
 import org.apache.jetspeed.security.mapping.model.Attribute;
@@ -65,7 +67,17 @@
     
     public Collection<String> getValues()
     {
-        return getDefinition().isMultiValue() ? values : null;
+        if(getDefinition().isMultiValue())
+        {
+         return values;         
+        }else{
+            if(value==null)
+            {
+                return Collections.emptyList();
+            }else{
+                return Arrays.asList(new String[]{value});
+            }
+        } 
     }
 
     public void setValues(Collection<String> values)



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message