improve error reporting from classcast

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@773986 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-05-12 17:14:24 +00:00
parent 4b4ce4aaf2
commit dd1b847ad7
1 changed files with 6 additions and 1 deletions

View File

@ -86,7 +86,12 @@ public class ResponseCorrelator extends TransportFilter {
} }
public void onCommand(Object o) { 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()) { if (command.isResponse()) {
Response response = (Response)command; Response response = (Response)command;
FutureResponse future = null; FutureResponse future = null;