cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1568108 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src...
Date Thu, 13 Feb 2014 23:06:55 GMT
Author: sergeyb
Date: Thu Feb 13 23:06:55 2014
New Revision: 1568108

URL: http://svn.apache.org/r1568108
Log:
Merged revisions 1568083-1568084 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1568083 | sergeyb | 2014-02-13 22:49:56 +0000 (Thu, 13 Feb 2014) | 1 line
  
  [CXF-5562] Relaxing the checks when injecting via setters, no need to have a name match
........
  r1568084 | sergeyb | 2014-02-13 22:52:55 +0000 (Thu, 13 Feb 2014) | 1 line
  
  [CXF-5562] One more test update
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1568083-1568084

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=1568108&r1=1568107&r2=1568108&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Thu Feb 13 23:06:55 2014
@@ -466,12 +466,14 @@ public class ClientProxyImpl extends Abs
         Map<String, Object> values = new HashMap<String, Object>();
         
         for (Method m : bean.getClass().getMethods()) {
-            if (m.getAnnotation(annClass) != null) {
+            Annotation annotation = m.getAnnotation(annClass);
+            if (annotation != null) {
                 try {
                     String propertyName = m.getName().substring(3);
                     Method getter = bean.getClass().getMethod("get" + propertyName, new Class[]{});
                     Object value = getter.invoke(bean, new Object[]{});
-                    values.put(propertyName.toLowerCase(), value);
+                    String annotationValue = AnnotationUtils.getAnnotationValue(annotation);
+                    values.put(annotationValue, value);
                 } catch (Throwable t) {
                     // ignore
                 }

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java?rev=1568108&r1=1568107&r2=1568108&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java
Thu Feb 13 23:06:55 2014
@@ -82,7 +82,7 @@ public abstract class BeanResourceInfo e
             }
             for (Annotation a : m.getAnnotations()) {
                 if (AnnotationUtils.isParamAnnotationClass(a.annotationType())) {
-                    checkParamMethod(m, AnnotationUtils.getAnnotationValue(a));
+                    addParamMethod(m);
                     break;
                 }
             }
@@ -110,10 +110,4 @@ public abstract class BeanResourceInfo e
         return paramFields == null ? Collections.<Field>emptyList() 
                                     : Collections.unmodifiableList(paramFields);
     }
-    
-    private void checkParamMethod(Method m, String value) {
-        if (m.getName().equalsIgnoreCase("set" + value)) {
-            addParamMethod(m);
-        }
-    }
 }

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java?rev=1568108&r1=1568107&r2=1568108&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
Thu Feb 13 23:06:55 2014
@@ -280,7 +280,7 @@ public class Customer extends AbstractCu
         return servletContext3;
     }
     
-    @QueryParam("a")
+    @QueryParam("a_value")
     public void setA(String a) {
         queryParam = a;
     }

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=1568108&r1=1568107&r2=1568108&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
Thu Feb 13 23:06:55 2014
@@ -1854,7 +1854,7 @@ public class JAXRSUtilsTest extends Asse
         MultivaluedMap<String, String> headers = new MetadataMap<String, String>();
         headers.add("AHeader2", "theAHeader2");
         m.put(Message.PROTOCOL_HEADERS, headers);
-        m.put(Message.QUERY_STRING, "a=aValue&query2=b");
+        m.put(Message.QUERY_STRING, "a_value=aValue&query2=b");
         JAXRSUtils.injectParameters(ori, c, m);
         assertEquals("aValue", c.getQueryParam());
         assertEquals("theAHeader2", c.getAHeader2());

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1568108&r1=1568107&r2=1568108&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Thu Feb 13 23:06:55 2014
@@ -1562,7 +1562,7 @@ public class BookStore {
             return id2;
         }
 
-        @QueryParam("id2")
+        @QueryParam("id_2")
         public void setId2(long id2) {
             this.id2 = id2;
         }

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1568108&r1=1568107&r2=1568108&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Thu Feb 13 23:06:55 2014
@@ -277,7 +277,7 @@ public class JAXRSClientServerBookTest e
     private void doTestUseParamBeanWebClient(String address) {
         WebClient wc = WebClient.create(address);
         wc.path("100");
-        wc.query("id2", "20");
+        wc.query("id_2", "20");
         wc.query("id3", "3");
         Book book = wc.get(Book.class);
         assertEquals(123L, book.getId());



Mime
View raw message