cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject [1/2] git commit: Workaround for [CXF-5803]: error processing by context injection
Date Tue, 01 Jul 2014 21:14:28 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 7fab676dc -> 5372863ce


Workaround for [CXF-5803]: error processing by context injection


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

Branch: refs/heads/master
Commit: 5edc42656ea858bb8eec3ba287caa8b30f7f8d62
Parents: d40ea83
Author: Andrei Shakirin <andrei.shakirin@gmail.com>
Authored: Tue Jul 1 23:12:46 2014 +0200
Committer: Andrei Shakirin <andrei.shakirin@gmail.com>
Committed: Tue Jul 1 23:12:46 2014 +0200

----------------------------------------------------------------------
 .../cxf/jaxrs/impl/tl/ThreadLocalInvocationHandler.java  | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5edc4265/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalInvocationHandler.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalInvocationHandler.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalInvocationHandler.java
index a6ba070..17278d3 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalInvocationHandler.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/tl/ThreadLocalInvocationHandler.java
@@ -32,8 +32,17 @@ public class ThreadLocalInvocationHandler<T> extends AbstractThreadLocalProxy<T>
             target = this;    
         } else {
             target = get();
+            if (target == null) {
+                if (m.getName().endsWith("toString")) {
+                    return null;
+                }
+                Class<?> contextCls = m.getDeclaringClass();
+                throw new NullPointerException(
+                                               contextCls.getName()
+                                                   + " context class has not been injected."
+                                                   + " Check if ContextProvider supporting
this class is registered");
+            }
         }
         return m.invoke(target, args);
     }
-
 }


Mime
View raw message