JDK-6195718 : Incorrect abstract interface semantics in JDK ValueHandler
  • Type: Bug
  • Component: other-libs
  • Sub-Component: corba:orb
  • Affected Version: 1.4.2_07
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: other
  • CPU: x86
  • Submitted: 2004-11-16
  • Updated: 2010-04-05
  • Resolved: 2004-12-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
1.3.1_16Fixed 1.4.2_08 b01Fixed
Description
It turns out that the JDK 1.4.2 ValueHandler is incorrectly determining
abstract interfaces in some circumstances, in the code of
com.sun.corba.se.internal.io.ObjectStreamClassCorbaExt we have this:

     static final boolean isAbstractInterface(Class cl) {

         Method[] method = ObjectStreamClassCorbaExt.getDeclaredMethods(cl);
         // Test for abstractness (used under rmi/iiop when determining
whether
         // to call read/write_Abstract

         if (!cl.isInterface()) {
             return false;
         }

         if (method.length == 0) {
             return false;
         }

However the Java to IDL spec (1.3.11) says:

Java interfaces that do not extend java.rmi.Remote directly or indirectly
and have no methods are also mapped to OMG IDL abstract interfaces. Hence
the above code is wrong.

This was discovered at a customer site who is having problems interoping
between WebSphere and WLS.


>>Let us know if you have a sample code to show this interop issue ?



public interface Foo {};
public class FooImpl implements Foo, Serializable {};
public class SomeFoo implements Serializable {
         private Foo my foo = new FooImpl();
}

public interface FooRemote implements Remote {
         public void tryFoo(SomeFoo foo) throws RemoteException;
}
###@###.### 2004-11-16 02:32:29 GMT

Comments
EVALUATION This is a bug in the implementation of the isAbstractInterface method (Class ObjectStreamClassCorbaExt.java). This implementation must return true, iff, 1. The supplied class is an interface, and 2. The class and all its ancestors do not implement java.rmi.Remote, and 3. if the class has no methods (including those of its ancestors), or, if all the methods (including those of its ancestors) throw an exception that is atleast java.rmi.RemoteException or one of java.rmi.RemoteException's super classes. ###@###.### 2004-11-16 23:20:47 GMT
16-11-2004