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

[Lworld] Javac fails to mark the synthetic field holding enclosing instance as ACC_FLATTENABLE where it should

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Reported by Rémi Forax in valhalla-dev:

      I've just tested several inner classes cases and everything seems fine,
      [...]
      I've still found a bug
      the field that reference the outer class is not marked as ACC_FLATENABLE even if the outer class is a value type.

      in this example,
      public __ByValue class Outer {
        private final int value;
        
        public Outer(int value) {
          this.value = value;
        }
        
        public __ByValue class Inner {
          private final int value2;
          
          public Inner(int value2) {
            this.value2 = value2;
          }
        }
      }

      javap says that inside Outer$Inner.class, this$0 is not ACC_FLATENABLE
        final fr.umlv.valuetype.Outer this$0;
          descriptor: Lfr/umlv/valuetype/Outer;
          flags: (0x1010) ACC_FINAL, ACC_SYNTHETIC

        Attachments

          Activity

            People

            • Assignee:
              sadayapalam Srikanth Adayapalam
              Reporter:
              sadayapalam Srikanth Adayapalam
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: