test/jdk/java/lang/invoke/VarHandles/VarHandleTestAccessByte.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                 VarHandleTestAccessByte.class, "final_v", byte.class);
    67                 VarHandleTestAccessByte.class, "final_v", byte.class);
    67 
    68 
   208                                               vhArray, VarHandleTestAccessByte::testArrayUnsupported,
   209                                               vhArray, VarHandleTestAccessByte::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, VarHandleTestAccessByte::testArrayIndexOutOfBounds,
   212                                               vhArray, VarHandleTestAccessByte::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     }
  1290             checkIOOBE(() -> {
  1290             checkIOOBE(() -> {
  1291                 byte o = (byte) vh.getAndBitwiseXorRelease(array, ci, (byte)0x01);
  1291                 byte o = (byte) vh.getAndBitwiseXorRelease(array, ci, (byte)0x01);
  1292             });
  1292             });
  1293         }
  1293         }
  1294     }
  1294     }
       
  1295 
  1295 }
  1296 }
  1296 
  1297