2009/11/10 Robert Godfrey <[email protected]>: > Hi Aidan, > > Why did you remove the setting of the linked exception here: > > --- > a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java > +++ > b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java > @@ -180,8 +180,6 @@ public class BasicMessageProducer_0_10 extends > BasicMessageProducer > catch (RuntimeException rte) > { > JMSException ex = new JMSException("Exception when sending > message"); > - rte.printStackTrace(); > - ex.setLinkedException(rte); > throw ex; > } > } > > Also, we probably want to communicate the stack trace somehow in > > --- > a/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java > +++ > b/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java > @@ -178,7 +178,6 @@ public class AMQProtocolHandlerTest extends TestCase > } > catch (Exception e) > { > - e.printStackTrace(); > fail(e.getMessage()); > } > } > > although I would think that just not catching the exception here would > probably do it... > > Don't immediately see any problems with the patch otherwise since no > information should be lost... (i.e. the stack should still print to a log > somewhere if desired I guess)
Removing the stackTrace alone here(AMQProtocolHandlerTest.java) is not the solution. This is a test and as Rob points out the exception needs to be reported back. I believe I wrote the test I clearly wasn't paing attention as calling fail() on a different thread will not fail the test. I'd say either leave the stacktrace in on this test .. with a comment asking anyone seeing this to please raise a JIRA; or ensure the exception is correctly communicated to the main test thread and test failure occurs. Just my thoughts. Martin > -- Rob > > 2009/11/10 Aidan Skinner <[email protected]> > >> QPID-2192 is a bug a user raised about the random printStackTrace >> calls that are littered about the place. This patch deletes all of the >> ones in java/client and java/common I found that they might run into. >> I'll commit this on Wednesday if nobody objects. The tests all pass >> and they're fairly clearly wrong AFAICT. >> >> - Aidan >> >> -- >> Apache Qpid - AMQP, JMS, other messaging love http://qpid.apache.org >> "A witty saying proves nothing" - Voltaire >> >> >> --------------------------------------------------------------------- >> Apache Qpid - AMQP Messaging Implementation >> Project: http://qpid.apache.org >> Use/Interact: mailto:[email protected] >> > -- Martin Ritchie --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
