[ 
https://issues.apache.org/jira/browse/QPID-1434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645519#action_12645519
 ] 

Rafael H. Schloming commented on QPID-1434:
-------------------------------------------

The name describes when it should be used, not exactly what it is doing. I tend 
to think those sorts of names are ok since usually names that describe exactly 
what a method does will eventually get out of date anyways, e.g. if we were to 
put a log statement in the method would we then need to change the name to 
logThenCloneForCurrentThread()?

In any case I'm not stuck on rethrow() as a name, but I do think it's 
significantly better than cloneForCurrentThread().

Regarding the style of a method that always throws, I tend to think it's worse 
style in general to always force the caller to do something that the method 
could do, but again I'm not particularly stuck on that point either since 
putting throw in front of the method call is fairly easy.

How about something like this:

throw ex.duplicate();

or

throw ex.recreate();

> Add ability to rethrow an AMQException
> --------------------------------------
>
>                 Key: QPID-1434
>                 URL: https://issues.apache.org/jira/browse/QPID-1434
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Common
>    Affects Versions: M3
>            Reporter: Martin Ritchie
>            Assignee: Rob Godfrey
>             Fix For: M4
>
>
> Summary:
> When we receive an exception we often simply rethrow by performing:
> throw receivedException;
> However this makes debugging difficult as the stack trace reflects the 
> original point where this exception occurred.
> Adding the ability to perform:
> receivedException.rethrow();
> As has been done to the TransportException in the 0-10 IO Transport layer 
> will allow us to improve our error reporting.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to