You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ge...@apache.org on 2005/02/11 15:17:53 UTC
svn commit: r153401 -
geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/JAXRException.java
Author: geirm
Date: Fri Feb 11 06:17:52 2005
New Revision: 153401
URL: http://svn.apache.org/viewcvs?view=rev&rev=153401
Log:
Fix it here, fix it there, let me fix it everywhere!
Modified:
geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/JAXRException.java
Modified: geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/JAXRException.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/JAXRException.java?view=diff&r1=153400&r2=153401
==============================================================================
--- geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/JAXRException.java (original)
+++ geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/JAXRException.java Fri Feb 11 06:17:52 2005
@@ -49,10 +49,11 @@
}
public synchronized Throwable initCause(Throwable cause) {
- if (this.cause != this)
- throw new IllegalStateException("Can't overwrite cause");
- if (cause == this)
- throw new IllegalArgumentException("Self-causation not permitted");
+
+ if (this.cause != null) {
+ throw new IllegalStateException("Cannot overwrite cause.");
+ }
+
this.cause = cause;
return this;
}
Re: svn commit: r153401 - geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/JAXRException.java
Posted by Jeremy Boynes <jb...@apache.org>.
Dain Sundstrom wrote:
> Why doesn't this just use 1.4 exception chaining? Is it a spec thing?
> I'm just curious.
>
There was something here from when I first wrote it. IIRC the cause
field is protected not private so we need to override the underlying
mechanism to initialize that field correctly; also they expect the
uninitialized value to be null whereas 1.4 sets it to this.
--
Jeremy
Re: svn commit: r153401 - geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/JAXRException.java
Posted by Dain Sundstrom <ds...@gluecode.com>.
Why doesn't this just use 1.4 exception chaining? Is it a spec thing?
I'm just curious.
-dain
--
Dain Sundstrom
Chief Architect
Gluecode Software
310.536.8355, ext. 26
On Feb 11, 2005, at 6:17 AM, geirm@apache.org wrote:
> Author: geirm
> Date: Fri Feb 11 06:17:52 2005
> New Revision: 153401
>
> URL: http://svn.apache.org/viewcvs?view=rev&rev=153401
> Log:
> Fix it here, fix it there, let me fix it everywhere!
>
> Modified:
>
> geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/
> JAXRException.java
>
> Modified:
> geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/
> JAXRException.java
> URL:
> http://svn.apache.org/viewcvs/geronimo/trunk/specs/jaxr/src/java/
> javax/xml/registry/JAXRException.java?view=diff&r1=153400&r2=153401
> =======================================================================
> =======
> ---
> geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/
> JAXRException.java (original)
> +++
> geronimo/trunk/specs/jaxr/src/java/javax/xml/registry/
> JAXRException.java Fri Feb 11 06:17:52 2005
> @@ -49,10 +49,11 @@
> }
>
> public synchronized Throwable initCause(Throwable cause) {
> - if (this.cause != this)
> - throw new IllegalStateException("Can't overwrite cause");
> - if (cause == this)
> - throw new IllegalArgumentException("Self-causation not
> permitted");
> +
> + if (this.cause != null) {
> + throw new IllegalStateException("Cannot overwrite
> cause.");
> + }
> +
> this.cause = cause;
> return this;
> }
>
>