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-7228] Using ClassHelper to get the real provider info class in some cases
Date Thu, 26 Jan 2017 16:41:51 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f8439a921 -> bf5dee134


[CXF-7228] Using ClassHelper to get the real provider info class in some cases


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

Branch: refs/heads/master
Commit: bf5dee1340b680f92f02d63d4801ed40af540dc5
Parents: f8439a9
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Jan 26 16:41:31 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Jan 26 16:41:31 2017 +0000

----------------------------------------------------------------------
 .../apache/cxf/jaxrs/provider/ProviderFactory.java    |  3 ++-
 .../cxf/jaxrs/provider/ServerProviderFactory.java     | 14 +++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/bf5dee13/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
index fd850de..a038f84 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
@@ -1224,7 +1224,8 @@ public abstract class ProviderFactory {
             names = ((FilterProviderInfo<?>)p).getNameBinding();
         }
         if (names == null) {
-            names = AnnotationUtils.getNameBindings(p.getProvider().getClass().getAnnotations());
+            Class<?> pClass = ClassHelper.getRealClass(p.getBus(), p.getProvider());
+            names = AnnotationUtils.getNameBindings(pClass.getAnnotations());
         }
         if (names.isEmpty()) {
             names = Collections.singleton(DEFAULT_FILTER_NAME_BINDING);

http://git-wip-us.apache.org/repos/asf/cxf/blob/bf5dee13/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
index 13cae5a..9c8ef9f 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
@@ -563,8 +563,9 @@ public final class ServerProviderFactory extends ProviderFactory {
         }
         private boolean isRegistered(Collection<?> list, Class<?> cls) {
             Collection<ProviderInfo<?>> list2 = CastUtils.cast(list);
-            for (ProviderInfo<?> pi : list2) {
-                if (cls.isAssignableFrom(pi.getProvider().getClass())) {
+            for (ProviderInfo<?> p : list2) {
+                Class<?> pClass = ClassHelper.getRealClass(p.getBus(), p.getProvider());
+                if (cls.isAssignableFrom(pClass)) {
                     return true;
                 }
             }
@@ -572,9 +573,12 @@ public final class ServerProviderFactory extends ProviderFactory {
         }
         private Integer getPriority(Collection<?> list, Class<?> cls, Class<?>
filterClass) {
             Collection<ProviderInfo<?>> list2 = CastUtils.cast(list);
-            for (ProviderInfo<?> pi : list2) {
-                if (pi instanceof FilterProviderInfo && pi.getProvider().getClass().isAssignableFrom(cls))
{
-                    return ((FilterProviderInfo<?>)pi).getPriority(filterClass);
+            for (ProviderInfo<?> p : list2) {
+                if (p instanceof FilterProviderInfo) {
+                    Class<?> pClass = ClassHelper.getRealClass(p.getBus(), p.getProvider());
+                    if (cls.isAssignableFrom(pClass)) {
+                        return ((FilterProviderInfo<?>)p).getPriority(filterClass);
+                    }
                 }
             }
             return Priorities.USER;


Mime
View raw message