FELIX-4393 :  @Property should accept empty name values on instance fields 

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1574483 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/annotations/changelog.txt b/scrplugin/annotations/changelog.txt
index 2e6c4e8..529117d 100644
--- a/scrplugin/annotations/changelog.txt
+++ b/scrplugin/annotations/changelog.txt
@@ -2,7 +2,7 @@
 ---------------------------
 ** Improvement
     * [FELIX-4277] - The maven-scr-plugin generates false warnings when using @SlingServlet
-
+    * [FELIX-4393] - @Property should accept empty name values on instance fields 
 
 Changes from 1.9.6 to 1.9.4
 ---------------------------
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 e76f1ec..e0af3e1 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
@@ -403,9 +403,29 @@
                         }
                     }
                 } else {
-                    final Object value = fieldAnnotation.getAnnotatedFieldValue();
-                    if (value != null) {
-                        name = value.toString();
+                    if ( Modifier.isStatic(fieldAnnotation.getAnnotatedField().getModifiers()) ) {
+                        final Object value = fieldAnnotation.getAnnotatedFieldValue();
+                        if (value != null) {
+                            name = value.toString();
+                        }
+                    } else {
+                        // non static, no name, no value (FELIX-4393)
+                        name = fieldAnnotation.getAnnotatedField().getName();
+                        final Object value = fieldAnnotation.getAnnotatedFieldValue();
+                        if (value != null) {
+                            if (value.getClass().isArray()) {
+                                final String[] newValues = new String[Array.getLength(value)];
+                                for (int i = 0; i < newValues.length; i++) {
+                                    newValues[i] = Array.get(value, i).toString();
+                                }
+                                prop.setMultiValue(newValues);
+                                prop.setType(PropertyType.from(fieldAnnotation.getAnnotatedField().getType().getComponentType()));
+                            } else {
+                                prop.setType(PropertyType.from(value.getClass()));
+                                prop.setValue(value.toString());
+                            }
+                        }
+
                     }
                 }
             }