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-6480] Avoiding NPE
Date Tue, 30 Jun 2015 21:27:41 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes cbe1a37f3 -> 249c6efff


[CXF-6480] Avoiding NPE


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

Branch: refs/heads/3.0.x-fixes
Commit: 249c6efff723bcf8fc06a6e602ef0e8cc5aab2b2
Parents: cbe1a37
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Jun 30 22:25:37 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Jun 30 22:27:13 2015 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/utils/InjectionUtils.java     | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/249c6eff/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
index 279f6a3..9491129 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
@@ -1010,12 +1010,15 @@ public final class InjectionUtils {
         } else if (SERVLET_CONFIG_CLASS_NAME.equals(name)) {
             proxyClassName = "org.apache.cxf.jaxrs.impl.tl.ThreadLocalServletConfig";
         }
-        try {
-            return (ThreadLocalProxy<?>)ClassLoaderUtils.loadClass(proxyClassName,
InjectionUtils.class)
-                .newInstance();
-        } catch (Throwable t) {
-            throw new RuntimeException(t);
+        if (proxyClassName != null) {
+            try {
+                return (ThreadLocalProxy<?>)ClassLoaderUtils.loadClass(proxyClassName,
InjectionUtils.class)
+                    .newInstance();
+            } catch (Throwable t) {
+                throw new RuntimeException(t);
+            }
         }
+        return null;
     }
     
     public static Method getGetterFromSetter(Method setter) throws Exception {


Mime
View raw message