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

abstract synchronized methods should not be allowed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1.4
    • tools
    • x86
    • windows_95



      Name: rm29839 Date: 11/05/97


      Compile the following Java source:

      // SyncTest.java - begin
      public abstract class SyncTest
      {
        public abstract synchronized void methodName();
      }
      // SyncTest.java - end

      Compile with:

      javac SyncTest.java

      The compile is successful but according to Sun's
      Java language specifications:

      http://java.sun.com/docs/books/jls/html/8.doc.html#78188

      Section 8.4.3 contains the sentence:

      A compile-time error occurs if a method declaration
      that contains the keyword abstract also contains any
      one of the keywords private, static, final, native
      or synchronized. Consequently, the above program
      should have been flagged as an error.
      (Review ID: 18865)
      ======================================================================
      ronan.mandel@Eng 1997-11-05

      Is the spec or the implementation wrong?

            dstoutamsunw David Stoutamire (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: