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

[lworld] type of expression in a synchronized statement can be an abstract value class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • tools

      14.19 The synchronized Statement of the JLS for 401 [1] states:


      SynchronizedStatement:
          synchronized ( Expression ) Block

      The type of Expression must be a reference type, and must not be a final value class type, or a type variable or intersection type bounded by a final value class type, or a compile-time error occurs.

      javac is not allowing value classes even if they are abstract, javac should be in sync with the latest spec

      [1] https://cr.openjdk.org/~dlsmith/jep401/jep401-20240222/specs/value-objects-jls.html

            vromero Vicente Arturo Romero Zaldivar
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: