test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessDouble.java
changeset 49788 5375d426822a
parent 47216 71c04702a3d5
child 52914 4fa75d8ad418
equal deleted inserted replaced
49787:99b627637911 49788:5375d426822a
    58 
    58 
    59     VarHandle vhStaticFinalField;
    59     VarHandle vhStaticFinalField;
    60 
    60 
    61     VarHandle vhArray;
    61     VarHandle vhArray;
    62 
    62 
       
    63 
    63     @BeforeClass
    64     @BeforeClass
    64     public void setup() throws Exception {
    65     public void setup() throws Exception {
    65         vhFinalField = MethodHandles.lookup().findVarHandle(
    66         vhFinalField = MethodHandles.lookup().findVarHandle(
    66                 VarHandleTestAccessDouble.class, "final_v", double.class);
    67                 VarHandleTestAccessDouble.class, "final_v", double.class);
    67 
    68 
   208                                               vhArray, VarHandleTestAccessDouble::testArrayUnsupported,
   209                                               vhArray, VarHandleTestAccessDouble::testArrayUnsupported,
   209                                               false));
   210                                               false));
   210         cases.add(new VarHandleAccessTestCase("Array index out of bounds",
   211         cases.add(new VarHandleAccessTestCase("Array index out of bounds",
   211                                               vhArray, VarHandleTestAccessDouble::testArrayIndexOutOfBounds,
   212                                               vhArray, VarHandleTestAccessDouble::testArrayIndexOutOfBounds,
   212                                               false));
   213                                               false));
   213 
       
   214         // Work around issue with jtreg summary reporting which truncates
   214         // Work around issue with jtreg summary reporting which truncates
   215         // the String result of Object.toString to 30 characters, hence
   215         // the String result of Object.toString to 30 characters, hence
   216         // the first dummy argument
   216         // the first dummy argument
   217         return cases.stream().map(tc -> new Object[]{tc.toString(), tc}).toArray(Object[][]::new);
   217         return cases.stream().map(tc -> new Object[]{tc.toString(), tc}).toArray(Object[][]::new);
   218     }
   218     }
  1181                 double o = (double) vh.getAndAddRelease(array, ci, 1.0d);
  1181                 double o = (double) vh.getAndAddRelease(array, ci, 1.0d);
  1182             });
  1182             });
  1183 
  1183 
  1184         }
  1184         }
  1185     }
  1185     }
       
  1186 
  1186 }
  1187 }
  1187 
  1188