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:28:59 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 4275bf063 -> 28b48973b


[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/28b48973
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/28b48973
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/28b48973

Branch: refs/heads/2.7.x-fixes
Commit: 28b48973bd8d8e29ae89e352044b3984bbc359f7
Parents: 4275bf0
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:28:37 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/28b48973/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 b33bf6b..5c38885 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
@@ -990,12 +990,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