qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Godfrey <rob.j.godf...@gmail.com>
Subject Re: Remove printStackTrace from client and common
Date Tue, 10 Nov 2009 03:40:04 GMT
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)

-- Rob

2009/11/10 Aidan Skinner <aidan@apache.org>

> 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:dev-subscribe@qpid.apache.org
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message