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

@Contended: explicit default value behaves differently from the implicit value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • hs25
    • hs25
    • hotspot
    • jdk: Java(TM) SE Runtime Environment 1.8.0 b89 (1.8.0-ea-b89)
      vm: Java HotSpot(TM) Client VM 25.0 b31 (25.0-b31)
      vmopts: -XX:+EnableContended -XX:-RestrictContended

    • b34

        public class Test {
            private static class T0 {
                @Contended("")
                private double double1;
                @Contended("")
                private double double2;
            }
            private static class T1 {
                @Contended
                private double double1;
                @Contended
                private double double2;
            }
        }

        Test$T0: field layout
          @ 12 --- instance fields start ---
          @144 "double1" D
          @152 "double2" D
          @ 12 --- instance fields end ---
          @288 --- instance ends ---
          @ 88 --- static fields start ---
          @ 88 --- static fields end ---

        Test$T1: field layout
          @ 12 --- instance fields start ---
          @144 "double1" D
          @280 "double2" D
          @ 12 --- instance fields end ---
          @416 --- instance ends ---
          @ 88 --- static fields start ---
          @ 88 --- static fields end ---

              shade Aleksey Shipilev
              iignatyev Igor Ignatyev (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: