United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6195718 : Incorrect abstract interface semantics in JDK ValueHandler

Details
Type:
Bug
Submit Date:
2004-11-16
Status:
Resolved
Updated Date:
2010-04-05
Project Name:
JDK
Resolved Date:
2004-12-03
Component:
other-libs
OS:
other
Sub-Component:
corba:orb
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2_07
Fixed Versions:
1.4.2_08 (b01)

Related Reports
Backport:
Backport:

Sub Tasks

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
                                     
2004-11-16



Hardware and Software, Engineered to Work Together