Repository: cxf Updated Branches: refs/heads/master d012b94b9 -> a1157adaf
[CXF-5826] making sure only setters are checked Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a1157ada Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a1157ada Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a1157ada Branch: refs/heads/master Commit: a1157adafdb757e461f5b696cc9bce46b2c96a4a Parents: d012b94 Author: Sergey Beryozkin <[email protected]> Authored: Thu Jun 26 22:24:03 2014 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Thu Jun 26 22:24:03 2014 +0100 ---------------------------------------------------------------------- .../cxf/jaxrs/client/ClientProxyImpl.java | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/a1157ada/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 91c7f0d..9faed5b 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 @@ -478,16 +478,18 @@ public class ClientProxyImpl extends AbstractClient implements Map<String, BeanPair> values = new HashMap<String, BeanPair>(); for (Method m : bean.getClass().getMethods()) { - 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[]{}); - String annotationValue = AnnotationUtils.getAnnotationValue(annotation); - values.put(annotationValue, new BeanPair(value, m.getParameterAnnotations()[0])); - } catch (Throwable t) { - // ignore + if (m.getName().startsWith("set")) { + 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[]{}); + String annotationValue = AnnotationUtils.getAnnotationValue(annotation); + values.put(annotationValue, new BeanPair(value, m.getParameterAnnotations()[0])); + } catch (Throwable t) { + // ignore + } } } }
