commit | e578dee73cf91851454232101d9dc59ce0df047f | [log] [tgz] |
---|---|---|
author | Carsten Ziegeler <cziegeler@apache.org> | Sun May 05 14:52:19 2013 +0000 |
committer | Carsten Ziegeler <cziegeler@apache.org> | Sun May 05 14:52:19 2013 +0000 |
tree | 036ee9c3c4bee879c792f05c31a0295f5a743b18 | |
parent | a91067376eb67c6ad7271fb5d5d5a2745c283b39 [diff] |
FELIX-4047 - Unable to single valued (String) array property git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1479335 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/annotations/changelog.txt b/scrplugin/annotations/changelog.txt index b1df35c..46e465e 100644 --- a/scrplugin/annotations/changelog.txt +++ b/scrplugin/annotations/changelog.txt
@@ -1,3 +1,9 @@ + Changes from 1.9.4 to 1.9.2 +---------------------------- +** + * [FELIX-4047] - Unable to single valued (String) array property + + Changes from 1.9.2 to 1.9.0 ---------------------------- ** Bug
diff --git a/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java b/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java index e318311..e76f1ec 100644 --- a/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java +++ b/scrplugin/annotations/src/main/java/org/apache/felix/scrplugin/processing/SCRAnnotationProcessor.java
@@ -438,6 +438,13 @@ prop.setCardinality(0); } + if ( prop.getValue() != null ) { + if ( prop.getUnbounded() == PropertyUnbounded.ARRAY || prop.getUnbounded() == PropertyUnbounded.VECTOR ) { + prop.setMultiValue(new String[] {prop.getValue()}); + } else if ( prop.getCardinality() < -1 || prop.getCardinality() > 1 ) { + prop.setMultiValue(new String[] {prop.getValue()}); + } + } // options final ScannedAnnotation[] options = (ScannedAnnotation[])ad.getValue("options"); if (options != null) {