cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [1/2] cxf git commit: [CXF-7473] simplified code
Date Thu, 07 Sep 2017 09:37:54 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 1eedb232f -> e47f445ba


[CXF-7473] simplified code


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

Branch: refs/heads/master
Commit: 49a1c64647c042b3bde735160734a443f4806315
Parents: 1eedb23
Author: Dennis Kieselhorst <deki@apache.org>
Authored: Thu Sep 7 11:37:05 2017 +0200
Committer: Dennis Kieselhorst <deki@apache.org>
Committed: Thu Sep 7 11:37:05 2017 +0200

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/provider/ProviderFactory.java   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/49a1c646/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 e21b5c1..9450f8e 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
@@ -292,7 +292,7 @@ public abstract class ProviderFactory {
                                        boolean injectContext) {
 
         Class<?> mapperClass = ClassHelper.getRealClass(bus, em.getProvider());
-        Type[] types = null;
+        Type[] types;
         if (m != null && MessageUtils.getContextualBoolean(m, IGNORE_TYPE_VARIABLES))
{
             types = new Type[]{mapperClass};
         } else {
@@ -302,14 +302,13 @@ public abstract class ProviderFactory {
             if (t instanceof ParameterizedType) {
                 ParameterizedType pt = (ParameterizedType)t;
                 Type[] args = pt.getActualTypeArguments();
-                for (int i = 0; i < args.length; i++) {
-                    Type arg = args[i];
+                for (Type arg : args) {
                     if (arg instanceof TypeVariable) {
-                        TypeVariable<?> var = (TypeVariable<?>)arg;
+                        TypeVariable<?> var = (TypeVariable<?>) arg;
                         Type[] bounds = var.getBounds();
                         boolean isResolved = false;
-                        for (int j = 0; j < bounds.length; j++) {
-                            Class<?> cls = InjectionUtils.getRawType(bounds[j]);
+                        for (Type bound : bounds) {
+                            Class<?> cls = InjectionUtils.getRawType(bound);
                             if (cls != null && (cls == Object.class || cls.isAssignableFrom(expectedType)))
{
                                 isResolved = true;
                                 break;


Mime
View raw message