United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4847777 : (spec) clarify that RemoteException constructors call initCause

Details
Type:
Bug
Submit Date:
2003-04-14
Status:
Resolved
Updated Date:
2003-08-13
Project Name:
JDK
Resolved Date:
2003-08-13
Component:
core-libs
OS:
solaris_9,solaris_7
Sub-Component:
java.rmi
CPU:
sparc,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0
Fixed Versions:
5.0 (tiger)

Related Reports
Duplicate:

Sub Tasks

Description
The following code causes an java.lang.IllegalStateException, but according to the documentation should not throw this.

Test() throws MarshalException{
		try { 
			throw new MarshalException(mystring);
		}
		catch(Exception e) {
			MarshalException me = new MarshalException("Scooby");
			me.initCause(e);
			throw me;
		}
	}

	public static void main(String args[]) throws MarshalException{ 
		new Test();
	}
}

                                    

Comments
EVALUATION

What package is MarshalException in?  I don't see that class in any of the
jdk packages.

-- iag@sfbay 2003-04-14

The spec should be more clear about this issue.  All RemoteException 
constructors call the initCause method to prevent subsequent invocations
of initCause.  RemoteException has a public field "detail" that contains 
the cause.  If initCause was allowed to be called, then it is possible
for the detail field to be set separately causing different values for
the "detail" cause held by RemoteException and the cause held by the
superclass Throwable.  To prevent this inconsistency from occuring, the 
initCause method cannot be called on a RemoteException instance.

This fact should be clearly spelled out in the documentation for RemoteException.
###@###.### 2003-04-14
                                     
2003-04-14
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger

FIXED IN:
tiger

INTEGRATED IN:
tiger
tiger-b15


                                     
2004-06-14



Hardware and Software, Engineered to Work Together