felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r767574 - in /felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag: PropertyTag.java Util.java
Date Wed, 22 Apr 2009 15:46:19 GMT
Author: cziegeler
Date: Wed Apr 22 15:46:19 2009
New Revision: 767574

URL: http://svn.apache.org/viewvc?rev=767574&view=rev
Log:
FELIX-1010 : Apply patch from Stefan Seifert to fix the compilation issue.

Modified:
    felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java
    felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java

Modified: felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java?rev=767574&r1=767573&r2=767574&view=diff
==============================================================================
--- felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java
(original)
+++ felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/PropertyTag.java
Wed Apr 22 15:46:19 2009
@@ -90,12 +90,7 @@
             public String[] value() {
                 // value property can be used as String[] or String property
                 Object obj = annotation.getNamedParameter("value");
-                if (obj instanceof List) {
-                    return Util.getStringValues(annotation, "value", Property.class);
-                }
-                else {
-                    return new String[] { Util.getStringValue(annotation, "value", Property.class)
};
-                }
+                return Util.getStringValues(annotation, "value", Property.class);
             }
 
             public Class<? extends java.lang.annotation.Annotation> annotationType()
{

Modified: felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java?rev=767574&r1=767573&r2=767574&view=diff
==============================================================================
--- felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java
(original)
+++ felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/annotation/defaulttag/Util.java
Wed Apr 22 15:46:19 2009
@@ -18,6 +18,7 @@
  */
 package org.apache.felix.scrplugin.tags.annotation.defaulttag;
 
+import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.List;
 
@@ -66,7 +67,14 @@
     public static String[] getStringValues(Annotation annotation, String name, final Class<?>
clazz) {
         final Object obj = annotation.getNamedParameter(name);
         if ( obj != null ) {
-            List<String> list = (List<String>)obj;
+            List<String> list;
+            if (obj instanceof String) {
+                list = new ArrayList<String>();
+                list.add((String)obj);
+            }
+            else {
+                list = (List<String>)obj;
+            }
             String[] values = new String[list.size()];
             for (int i=0; i<values.length; i++) {
                 values[i] = stripQuotes(list.get(i));
@@ -144,7 +152,7 @@
                 if (dotPos >= 0) {
                     enumName = enumName.substring(dotPos+1);
                 }
-                return Enum.valueOf(enumClass, enumName);
+                return (T)Enum.valueOf(enumClass, enumName);
             }
         }
         return null;



Mime
View raw message