Description
I have the following stack frame in an application i'm working with:
java.lang.ClassCastException: java.lang.OutOfMemoryError cannot be cast to java.lang.Exception
at org.apache.avro.ipc.specific.SpecificResponder.respond(SpecificResponder.java:90)
at org.apache.avro.ipc.Responder.respond(Responder.java:149)
at org.apache.avro.ipc.SocketServer$Connection.run(SocketServer.java:116)
at java.lang.Thread.run(Thread.java:662)
Nothing too surprising, here's the code:
@Override public Object respond(Message message, Object request) throws Exception { ... } catch (InvocationTargetException e) { throw (Exception)e.getTargetException(); ...
It's probably a bug that this ends up with a ClassCastException. Any suggestions? I don't think we can change the signature to Exception. We could check instanceof and wrap the Throwable if it's not an Exception?