Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DAE9A17A7F for ; Thu, 23 Apr 2015 16:00:57 +0000 (UTC) Received: (qmail 81691 invoked by uid 500); 23 Apr 2015 16:00:57 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 81631 invoked by uid 500); 23 Apr 2015 16:00:57 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 81622 invoked by uid 99); 23 Apr 2015 16:00:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2015 16:00:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8E8A5E1789; Thu, 23 Apr 2015 16:00:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: <7d0c21927a5a4b8283a2f770a1d3e13f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6367] Adding a test and another fix Date: Thu, 23 Apr 2015 16:00:57 +0000 (UTC) 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 Authored: Thu Apr 23 16:58:25 2015 +0100 Committer: Sergey Beryozkin 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; }