Issue 2545: mapping of java.lang.Exception (java2idl-rtf) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: I took another look at 28.3.7.1, and I think that the current special-case mapping of java.lang.Exception is odd and unnecessary. It seems to me that the right thing to do is to simply remove this special case, and map it the same as any other exception. So, java.lang.Exception should map to a valuetype that has ::java::lang::Throwable as a superclass and no data fields, and to an IDL exception of ::java::lang::Ex (note that this exception is used in an example in 28.3.4.6). java.lang.Throwable should map to a valuetype that has no superclass and a private data field named detailMessage, and to an IDL exception of ::java::lang::ThrowableEx. Resolution: Closed, accepted Revised Text: Section 28.2.3 Change #4 to: 4. All checked exception classes used in method declarations (other than java.rmi.RemoteException and its subclasses) are conforming RMI/IDL exception types (see "RMI/IDL Exception Types" on page 28-5). Change the footnote for this to: 1. Because unchecked exception classes and java.rmi.RemoteException and its subclasses are not mapped to IDL exceptions, it is not necessary for them to be conforming RMI/IDL exception types. Section 28.2.6 Change the first sentence to: An RMI/IDL exception type is a checked exception class (as defined by the Java Language Specification). Change the beginning of the second sentence to: Since checked exception classes extend java.lang.Throwable ... In the second paragraph, change the first bullet to: - is a checked exception class Section 28.3.5 Add to the end of the first sentence: "and conforming exception classes that are not RMI/IDL exception types". Section 28.3.4.3 Change the last bullet of Read-write properties to: - get<name> and set<name> do not throw any checked exceptions except for java.rmi.RemoteException and its subclasses, Change the last bullet of Read-only properties to: - does not throw any checked exceptions except for java.rmi.RemoteException and its subclasses, Section 28.3.4.4 Change #5 and #6 to: 5. Each declared RMI/IDL exception type (other than java.rmi.RemoteException and its subclasses) is mapped to the corresponding OMG IDL exception. 6. java.rmi.RemoteException and its subclasses, and unchecked exception classes, are assumed to be mapped to the implicit CORBA system exception, and are therefore not explicitly declared in OMG IDL. Section 28.3.5.4 Change #3 to: 3. Each declared RMI/IDL exception type (other than java.rmi.RemoteException and its subclasses) is mapped to the corresponding OMG IDL exception. 4. java.rmi.RemoteException and its subclasses, and unchecked exception classes, are not explicitly declared in OMG IDL. Section 28.3.7.1 Delete the first sentence and the IDL that immediately follows. At the beginning of the next sentence, change "Every other" to "Each". Section 28.3.7.2 In the first bullet, delete 'or "Error"'. Section 28.4.7 Change the second and third sentences to: Exceptions that are instances of (or subclasses of) RMI/IDL exception types declared by the method are marshaled as user exceptions in the usual way. All other Java exceptions are marshaled as CORBA UNKNOWN system exceptions whose GIOP Reply message includes an UnknownExceptionInfo service context containing the marshaled Java exception thrown by the server implementation. Actions taken: March 16, 1999: received issue June 4, 1999: closed issue Discussion: End of Annotations:===== Date: Mon, 15 Mar 1999 17:54:46 -0500 (EST) From: Bob Scheifler - SMI Software Development Reply-To: Bob Scheifler - SMI Software Development Subject: mapping of java.lang.Exception To: java2idl-rtf@omg.org, issues@omg.org Cc: Steve Lewallen , Bryan Atsatt Content-MD5: Hv1hhQXcuKGMk165eQJU2w== I took another look at 28.3.7.1, and I think that the current special-case mapping of java.lang.Exception is odd and unnecessary. It seems to me that the right thing to do is to simply remove this special case, and map it the same as any other exception. So, java.lang.Exception should map to a valuetype that has ::java::lang::Throwable as a superclass and no data fields, and to an IDL exception of ::java::lang::Ex (note that this exception is used in an example in 28.3.4.6). java.lang.Throwable should map to a valuetype that has no superclass and a private data field named detailMessage, and to an IDL exception of ::java::lang::ThrowableEx. The current spec also has a name clash, in that both java.lang.Exception and java.lang.Error map to the same IDL exception ::java::lang::Ex. This needs to be fixed. I'll suggest that the way it be fixed is by uniformly using different suffixes. Proposal: Delete the first sentence of 28.3.7.1 and the IDL that follows it. At the beginning of the next sentence, change "Every other" to "Each". In 28.3.7.2, change the second bullet from: - Adding an "Ex" at the end of the name to: - Adding an "Err" at the end of the name if the class is a subclass of (or is) java.lang.Error, else adding an "Ex". - Bob