Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1842111235 for ; Tue, 1 Jul 2014 21:14:29 +0000 (UTC) Received: (qmail 99991 invoked by uid 500); 1 Jul 2014 21:14:29 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 99853 invoked by uid 500); 1 Jul 2014 21:14:28 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 99837 invoked by uid 99); 1 Jul 2014 21:14:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Jul 2014 21:14:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 980F39926C8; Tue, 1 Jul 2014 21:14:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ashakirin@apache.org To: commits@cxf.apache.org Date: Tue, 01 Jul 2014 21:14:28 -0000 Message-Id: <2b20e3898266449f970afe3f37320b5b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: Workaround for [CXF-5803]: error processing by context injection 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 Authored: Tue Jul 1 23:12:46 2014 +0200 Committer: Andrei Shakirin 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 extends AbstractThreadLocalProxy 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); } - }