google-code-export / rocket-gwt

Automatically exported from code.google.com/p/rocket-gwt
1 stars 1 forks source link

Constructor of Throwable replacement is incorrect #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using the Throwable replacement from the Rocket library it doesn't
work with the default constructor as it doesn't call "this.saveCallStack()"
- but it should. (Check 

To prevent this (and similiar problems) from happening in the future the
constructor code (for all(!) constructors) should be replaced with the
following snippet:

    public Throwable() {
        this(null, null);
    }

    public Throwable(String message) {
        this(message, null);
    }

    public Throwable(Throwable cause) {
        this((cause == null) ? null : cause.toString(), cause);
    }

    public Throwable(String message, Throwable cause) {
        this.cause = cause;
        this.detailMessage = message;

        this.saveCallStack();
    }

Rocket Library: 0.56 (or trunk)
GWT: 1.5.3

Original issue reported on code.google.com by goo...@mail.manski.net on 9 Jan 2009 at 9:49

GoogleCodeExporter commented 9 years ago
Thanx for catching the missed save call stack in the no args 
constrictor...

Because saveCallStack drops a few of the top elements 
instead of chaining one ctr to call another etc I've added the 
saveCallStack call to the no args ctr so it is complete...

Original comment by miroslav...@gmail.com on 22 Jan 2009 at 10:10