activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
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 GMT
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;



Mime
View raw message