cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r979459 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/provider/ main/java/org/apache/cxf/jaxrs/utils/ test/java/org/apache/cxf/jaxrs/model/wadl/
Date Mon, 26 Jul 2010 21:46:03 GMT
Author: sergeyb
Date: Mon Jul 26 21:46:02 2010
New Revision: 979459

URL: http://svn.apache.org/viewvc?rev=979459&view=rev
Log:
Fixing StachOverflow in InjectionUtils plus a couple of other minor updates

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java?rev=979459&r1=979458&r2=979459&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
Mon Jul 26 21:46:02 2010
@@ -234,6 +234,7 @@ public class JAXBElementProvider extends
             String encoding = HttpUtils.getSetEncoding(m, headers, null);
             if (InjectionUtils.isSupportedCollectionOrArray(actualClass)) {
                 actualClass = InjectionUtils.getActualType(genericType);
+                actualClass = getActualType(actualClass, genericType, anns);
                 marshalCollection(cls, actualObject, actualClass, genericType, encoding,
os, m);
             } else {
                 marshal(actualObject, actualClass, genericType, encoding, os, m);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java?rev=979459&r1=979458&r2=979459&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
Mon Jul 26 21:46:02 2010
@@ -263,6 +263,7 @@ public class JSONProvider extends Abstra
             
             if (InjectionUtils.isSupportedCollectionOrArray(actualClass)) {
                 actualClass = InjectionUtils.getActualType(genericType);
+                actualClass = getActualType(actualClass, genericType, anns);
                 marshalCollection(cls, actualObject, actualClass, genericType, encoding,
os, m);
             } else {
                 marshal(actualObject, actualClass, genericType, encoding, os);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=979459&r1=979458&r2=979459&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
Mon Jul 26 21:46:02 2010
@@ -866,7 +866,7 @@ public final class InjectionUtils {
             if (m.getName().startsWith("get") && m.getParameterTypes().length ==
0 
                 && m.getName().length() > 3) {
                 String propertyName = m.getName().substring(3).toLowerCase();
-                if ("class".equals(propertyName) 
+                if (m.getReturnType() == Class.class
                     || checkIgnorable && canPropertyBeIgnored(m, propertyName)) {
                     continue;
                 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=979459&r1=979458&r2=979459&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java Mon
Jul 26 21:46:02 2010
@@ -362,8 +362,21 @@ public final class JAXRSUtils {
             return ori;
         }
         
-        int status = pathMatched == 0 ? 404 : methodMatched == 0 ? 405 
-                     : consumeMatched == 0 ? 415 : produceMatched == 0 ? 406 : 404;
+        int status;
+        
+        if (pathMatched == 0) {
+            status = 404;
+        } else if (methodMatched == 0) {
+            status = 405;
+        } else if (consumeMatched == 0) {
+            status = 415;
+        } else if (produceMatched == 0) {
+            status = 406;
+        } else {
+            // this branch should not even be executed 
+            status = 404;
+        }
+        
         String name = resource.isRoot() ? "NO_OP_EXC" : "NO_SUBRESOURCE_METHOD_FOUND";
         org.apache.cxf.common.i18n.Message errorMsg = 
             new org.apache.cxf.common.i18n.Message(name, 

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java?rev=979459&r1=979458&r2=979459&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/BookStore.java
Mon Jul 26 21:46:02 2010
@@ -145,6 +145,10 @@ public class BookStore {
             return bean;
         }
         
+        public TestEnum getE() {
+            return TestEnum.A;
+        }
+        
     }
     
     public static class QueryBean2 {
@@ -179,4 +183,8 @@ public class BookStore {
             return b;
         }
     }
+    
+    public static enum TestEnum {
+        A;        
+    }
 }



Mime
View raw message