[lworld] RFR: 8335279: [lworld] javac should attribute instance initializers according to their final location relative to the super ctor invocation

Vicente Romero vromero at openjdk.org
Sat Jun 29 20:59:31 UTC 2024


this code:


value class Test {
    Test t = null;
    Runnable r = () -> { System.err.println(t); };
}

was being accepted by javac but then failed with a verifier error at run time. When attributing instance initializers javac should take into account the position they will have in the constructor relative to the super constructor invocation

-------------

Commit messages:
 - 8335279: [lworld] javac should attribute instance initializers according to their final location relative to the super ctor invocation

Changes: https://git.openjdk.org/valhalla/pull/1151/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1151&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8335279
  Stats: 21 lines in 2 files changed: 17 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/valhalla/pull/1151.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1151/head:pull/1151

PR: https://git.openjdk.org/valhalla/pull/1151


More information about the valhalla-dev mailing list