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

XMLWordPrintable

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

      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

            sadayapalam Srikanth Adayapalam (Inactive)
            sadayapalam Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: