Am 01.10.2011 18:19, schrieb Sean Mullan:
On 9/30/11 2:15 PM, Sebastian Sickelmann wrote:
I think I know the reason. If you allow initCause to be called when a
cause is
not initially provided, then getCause will still return null, which
seems wrong.

getCause() of Throwable and all classes that doesn't had a chaining
before
Throwable introduces it, doing this excact this way. Whats wrong on this?

         return (cause==this ? null : cause); // Where the initial
value(uninitialied) of cause is this.
Does this make sense? I actually not sure i understand you right.
The following code:

         KeySelectorException kse = new KeySelectorException("foo");
         kse.initCause(new Exception("bar"));
         System.out.println(kse.getCause());

prints null as the cause, even though initCause was subsequently called. Do you
see my concern?
This is one of the places in code which must be changes to match the initCause behavoir of Throwable.

I have done it here:

http://dl.dropbox.com/u/43692695/oss-patches/openjdk8/NoSuchMechanismException/7011804_5/index.html

But is this the best way? Or should we just follow the other Exceptions and start an seperate discussion on this with core-libs-dev?

http://dl.dropbox.com/u/43692695/oss-patches/openjdk8/NoSuchMechanismException/7011804_4/index.html
Thanks!
--Sean


Reply via email to