felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1220719 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
Date Mon, 19 Dec 2011 12:35:46 GMT
Author: fmeschbe
Date: Mon Dec 19 12:35:46 2011
New Revision: 1220719

URL: http://svn.apache.org/viewvc?rev=1220719&view=rev
Log:
FELIX-3285 properly handle some multi-value cases
  - prevent setting empty vectors/collections
  - make sure an existing array property gets a synthetic array descriptor

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java?rev=1220719&r1=1220718&r2=1220719&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
Mon Dec 19 12:35:46 2011
@@ -925,8 +925,15 @@ public class ConfigManager extends Confi
 
                     if ( ad.getCardinality() < 0 )
                     {
-                        // keep the vector
-                        props.put( propName, vec );
+                        // keep the vector, but only add if not empty
+                        if ( vec.isEmpty() )
+                        {
+                            props.remove( propName );
+                        }
+                        else
+                        {
+                            props.put( propName, vec );
+                        }
                     }
                     else
                     {
@@ -1072,7 +1079,7 @@ public class ConfigManager extends Confi
         }
         else if ( value.getClass().isArray() )
         {
-            attrCardinality = Integer.MIN_VALUE;
+            attrCardinality = Integer.MAX_VALUE;
             type = value.getClass().getComponentType();
         }
         else



Mime
View raw message