From commits-return-10758-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Tue May 12 17:14:49 2009 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 47782 invoked from network); 12 May 2009 17:14:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 May 2009 17:14:48 -0000 Received: (qmail 59173 invoked by uid 500); 12 May 2009 17:14:48 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 59120 invoked by uid 500); 12 May 2009 17:14:48 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 59111 invoked by uid 99); 12 May 2009 17:14:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2009 17:14:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 May 2009 17:14:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 89084238896D; Tue, 12 May 2009 17:14:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r773986 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java Date: Tue, 12 May 2009 17:14:24 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090512171424.89084238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Tue May 12 17:14:24 2009 New Revision: 773986 URL: http://svn.apache.org/viewvc?rev=773986&view=rev Log: improve error reporting from classcast Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java?rev=773986&r1=773985&r2=773986&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java (original) +++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/ResponseCorrelator.java Tue May 12 17:14:24 2009 @@ -86,7 +86,12 @@ } public void onCommand(Object o) { - Command command = (Command)o; + Command command = null; + if (o instanceof Command) { + command = (Command)o; + } else { + throw new ClassCastException("Object cannot be converted to a Command, Object: " + o); + } if (command.isResponse()) { Response response = (Response)command; FutureResponse future = null;