[lworld] Integrated: 8330583: [lworld] javac doesn't set ACC_STRICT to final synthetic fields in value classes

Vicente Romero vromero at openjdk.org
Mon Apr 22 21:50:41 UTC 2024


On Mon, 22 Apr 2024 20:52:29 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> javac is not setting the ACC_STRICT flag to final synthetic fields in value classes. The code below reproduces the issue:
> 
> 
> class NestedTest {
>     value class MyValue {
>         int i = 0;
> 
>         public String toString() {
>             return "MyValue("+i+","+outerInt+")";
>         }
>     }
> 
>     int outerInt = 42;
>     MyValue v = new MyValue();
> 
>     public static void main(String[] args) {
>         NestedTest nt = new NestedTest();
>     }
> }
> 
> in this case class MyValue has an outer this field of type NestedTest which is final and synthetic but in the case of value classes should also be strict.

This pull request has now been integrated.

Changeset: 6c5d2658
Author:    Vicente Romero <vromero at openjdk.org>
URL:       https://git.openjdk.org/valhalla/commit/6c5d265834ef81d79cbbe51a89d8ed523a63060d
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8330583: [lworld] javac doesn't set ACC_STRICT to final synthetic fields in value classes

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

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



More information about the valhalla-dev mailing list