cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccri...@apache.org
Subject [cxf] branch master updated: Use ReflectionUtil rather than a new doPriv inner class
Date Thu, 26 Oct 2017 18:38:24 GMT
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new bd644f3  Use ReflectionUtil rather than a new doPriv inner class
bd644f3 is described below

commit bd644f3e95e9560f81f175dfdf50d808b908515e
Author: Andy McCright <j.andrew.mccright@gmail.com>
AuthorDate: Thu Oct 26 13:38:08 2017 -0500

    Use ReflectionUtil rather than a new doPriv inner class
---
 .../java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java  | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java
index 6134e9d..4055654 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/BeanResourceInfo.java
@@ -41,13 +41,12 @@ package org.apache.cxf.jaxrs.model;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.util.ReflectionUtil;
 import org.apache.cxf.jaxrs.utils.AnnotationUtils;
 
 public abstract class BeanResourceInfo extends AbstractResourceInfo {
@@ -80,7 +79,7 @@ public abstract class BeanResourceInfo extends AbstractResourceInfo {
         if (Object.class == cls || cls == null) {
             return;
         }
-        for (Field f : getDeclaredFields(cls)) {
+        for (Field f : ReflectionUtil.getDeclaredFields(cls)) {
             for (Annotation a : f.getAnnotations()) {
                 if (AnnotationUtils.isParamAnnotationClass(a.annotationType())) {
                     if (paramFields == null) {
@@ -131,13 +130,4 @@ public abstract class BeanResourceInfo extends AbstractResourceInfo {
         return paramFields == null ? Collections.<Field>emptyList()
                                     : Collections.unmodifiableList(paramFields);
     }
-    
-    private static Field[] getDeclaredFields(final Class<?> cls) {
-        return AccessController.doPrivileged(new PrivilegedAction<Field[]>() {
-
-            @Override
-            public Field[] run() {
-                return cls.getDeclaredFields();
-            } });
-    }
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <commits@cxf.apache.org>'].

Mime
View raw message