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

redundant errors for method body in interfaces.

XMLWordPrintable

    • mantis
    • sparc
    • solaris_9
    • Verified

      consider the following code,

      public interface test
      {
      public void doNothing ()
      {
      System.out.println ("get some Errors !");
      }
      }

      Old Javac (1.2.2) emits only one error, while the JavaC, (1.3 and 1.4) emits
      two messages (as followed).

      jtools-sqe:/home/vr128054/vertest/work 198 % javac test.java
      test.java:4: interface methods cannot have body
              {
              ^
      test.java:3: interface methods cannot have body
              public void doNothing ()
                          ^
      2 errors

      jtools-sqe:/home/vr128054/vertest/work 200 % javac -J-version
      java version "1.4.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b76)
      Java HotSpot(TM) Client VM (build 1.4.0-beta2-b76, mixed mode)

            gafter Neal Gafter (Inactive)
            rvijayansunw Ra Vijayan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: