Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4070653

stub uses interface's throws clause, not class's

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.1
    • core-libs
    • None
    • 1.2beta2
    • sparc
    • solaris_2.5.1
    • Not verified

      The following code should work but the stub won't compile because rmic generates a throws clause from one of the interfaces instead of using the class's throws clause which is compatible with both interfaces:

      import java.rmi.*;
       
      class MyException extends Exception { }
      class OtherException extends Exception { }
       
      interface t1 extends Remote {
          public void foo() throws MyException, RemoteException;
      }
       
      interface t2 extends Remote {
          public void foo() throws MyException, RemoteException, OtherException;
      }
       
      class tImpl implements t1, t2 {
          public void foo() {
              ;
          }
      }

            peterjones Peter Jones (Inactive)
            karnoldsunw Kenneth Arnold (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: