commit | 789f8b42cc1519853587ae949954eb63177a32e7 | [log] [tgz] |
---|---|---|
author | Felix Meschberger <fmeschbe@apache.org> | Mon Dec 19 12:35:46 2011 +0000 |
committer | Felix Meschberger <fmeschbe@apache.org> | Mon Dec 19 12:35:46 2011 +0000 |
tree | e471365f0530c89625e2a5c27ee75b50886fd7f5 | |
parent | 26969595aad23b5d9ae9f87656546c9970828230 [diff] |
FELIX-3285 properly handle some multi-value cases - prevent setting empty vectors/collections - make sure an existing array property gets a synthetic array descriptor git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1220719 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java index 8db289d..f66b120 100644 --- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java +++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
@@ -925,8 +925,15 @@ 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 @@ } else if ( value.getClass().isArray() ) { - attrCardinality = Integer.MIN_VALUE; + attrCardinality = Integer.MAX_VALUE; type = value.getClass().getComponentType(); } else