Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 55071 invoked from network); 15 Nov 2006 21:37:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2006 21:37:49 -0000 Received: (qmail 31501 invoked by uid 500); 15 Nov 2006 21:37:58 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 31395 invoked by uid 500); 15 Nov 2006 21:37:58 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 31384 invoked by uid 500); 15 Nov 2006 21:37:58 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 31381 invoked by uid 99); 15 Nov 2006 21:37:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 13:37:58 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 13:37:47 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8C5431A984A; Wed, 15 Nov 2006 13:37:16 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r475441 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java Date: Wed, 15 Nov 2006 21:37:16 -0000 To: axis2-cvs@ws.apache.org From: davidillsley@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061115213716.8C5431A984A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: davidillsley Date: Wed Nov 15 13:37:15 2006 New Revision: 475441 URL: http://svn.apache.org/viewvc?view=rev&rev=475441 Log: Merge changes from r471671 Replace NPE with specific exception to improve clarity of a failure case. Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java?view=diff&rev=475441&r1=475440&r2=475441 ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CallbackReceiver.java Wed Nov 15 13:37:15 2006 @@ -16,18 +16,17 @@ package org.apache.axis2.util; +import java.util.HashMap; + import org.apache.axiom.soap.SOAPEnvelope; import org.apache.axiom.soap.SOAPFault; import org.apache.axis2.AxisFault; import org.apache.axis2.addressing.RelatesTo; -import org.apache.axis2.addressing.AddressingConstants; import org.apache.axis2.client.async.AsyncResult; import org.apache.axis2.client.async.Callback; import org.apache.axis2.context.MessageContext; import org.apache.axis2.engine.MessageReceiver; -import java.util.HashMap; - /** * This is a MessageReceiver which is used on the client side to accept the * messages (response) that come to the client. This correlates the incoming message to @@ -47,6 +46,9 @@ public void receive(MessageContext messageCtx) throws AxisFault { RelatesTo relatesTO = messageCtx.getOptions().getRelatesTo(); + if(relatesTO == null){ + throw new AxisFault("Cannot identify correct Callback object. RelatesTo is null"); + } String messageID = relatesTO.getValue(); Callback callback = (Callback) callbackStore.get(messageID); AsyncResult result = new AsyncResult(messageCtx); --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org