cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1176856 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
Date Wed, 28 Sep 2011 13:00:00 GMT
Author: sergeyb
Date: Wed Sep 28 12:59:59 2011
New Revision: 1176856

URL: http://svn.apache.org/viewvc?rev=1176856&view=rev
Log:
[CXF-2313] Minor update to the servlet

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java?rev=1176856&r1=1176855&r2=1176856&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
Wed Sep 28 12:59:59 2011
@@ -245,7 +245,7 @@ public class CXFNonSpringJaxrsServlet ex
     
     private String getClassNameAndProperties(String cName, Map<String, String> props)
{
         String theName = cName.trim();
-        int ind = theName.lastIndexOf("(");
+        int ind = theName.indexOf("(");
         if (ind != -1 && theName.endsWith(")")) {
             props.putAll(CastUtils.cast(handleMapSequence(theName.substring(ind + 1, theName.length()
- 1)),
                     String.class, String.class));
@@ -323,7 +323,12 @@ public class CXFNonSpringJaxrsServlet ex
                            + entry.getKey().substring(1));
             if (m != null) {
                 Class<?> type = m.getParameterTypes()[0];
-                Object value = PrimitiveUtils.read(entry.getValue(), type);
+                Object value = entry.getValue();
+                if (InjectionUtils.isPrimitive(type)) {
+                    value = PrimitiveUtils.read(entry.getValue(), type);
+                } else if (List.class.isAssignableFrom(type)) {
+                    value = Collections.singletonList(value);
+                } 
                 InjectionUtils.injectThroughMethod(instance, m, value);
             }
         }



Mime
View raw message