cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6367] Adding a test and another fix
Date Thu, 23 Apr 2015 16:00:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 3fe914c93 -> cf211b15d


[CXF-6367] Adding a test and another fix


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cf211b15
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cf211b15
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cf211b15

Branch: refs/heads/3.0.x-fixes
Commit: cf211b15d56f1351cdb40c99958c26d45efdba9d
Parents: 3fe914c
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Apr 23 16:58:25 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Apr 23 17:00:38 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java | 6 ++++--
 .../src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java  | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/cf211b15/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index 3bbb325..c9b211e 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -61,6 +61,7 @@ import org.apache.cxf.common.classloader.ClassLoaderUtils.ClassLoaderHolder;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PropertyUtils;
+import org.apache.cxf.common.util.ReflectionUtil;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.CastUtils;
@@ -492,13 +493,14 @@ public class ClientProxyImpl extends AbstractClient implements
                             values.put(annotationValue, new BeanPair(value, m.getParameterAnnotations()[0]));
                         }
                     } else {
-                        Field f = bean.getClass().getField(StringUtils.uncapitalize(propertyName));
+                        String fieldName = StringUtils.uncapitalize(propertyName);
+                        Field f = ReflectionUtil.getDeclaredField(bean.getClass(), fieldName);
                         if (f == null) {
                             continue;
                         }
                         annotation = f.getAnnotation(annClass);
                         if (annotation != null) {
-                            Object value = f.get(bean);
+                            Object value = ReflectionUtil.accessDeclaredField(f, bean, Object.class);
                             if (value != null) {
                                 String annotationValue = AnnotationUtils.getAnnotationValue(annotation);
                                 values.put(annotationValue, new BeanPair(value, f.getAnnotations()));

http://git-wip-us.apache.org/repos/asf/cxf/blob/cf211b15/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
index 3bbf7c3..57da727 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
@@ -1664,6 +1664,7 @@ public class BookStore {
     
     public static class BookBean {
         private long id;
+        @QueryParam("id_2")
         private long id2;
         private long id3;
 
@@ -1680,7 +1681,6 @@ public class BookStore {
             return id2;
         }
 
-        @QueryParam("id_2")
         public void setId2(long id2) {
             this.id2 = id2;
         }


Mime
View raw message