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

Compile-time checking of exceptions not always working...

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.1.3
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      Name: tb29552 Date: 09/15/97


      Let's have three source files:

      //Test1.java
      public class Test1 extends Test2 implements Test3 {
      }

      //Test2.java
      public class Test2 {
          public void test() throws Exception {
              throw new Exception();
          }
      }

      //Test3.java
      public interface Test3 {
          public void test();
      }

      In my opinion, the compiler should report an
      error, because Test1.test() (inherited from Test2)
      throws Exception, even though it should not
      (because it implements Test3).

      When I compiled with JDK 1.1.3 javac, I got no
      error messages.

      I feel this is a serious problem because
      in some circumstances some completely unexcpected
      exceptions may occur in application, that should
      have been caught early in some library.

      I have faced the problem in development of a real
      application.

      company - Tecnomen Oy , email - ###@###.###
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dstoutamsunw David Stoutamire (Inactive)
              Reporter:
              tbell Tim Bell
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: