< prev index next >

test/java/lang/invoke/VarHandles/VarHandleTestAccessShort.java

Print this page




  25  * @test
  26  * @run testng/othervm -Diters=10    -Xint                   VarHandleTestAccessShort
  27  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessShort
  28  * @run testng/othervm -Diters=20000                         VarHandleTestAccessShort
  29  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessShort
  30  */
  31 
  32 import org.testng.annotations.BeforeClass;
  33 import org.testng.annotations.DataProvider;
  34 import org.testng.annotations.Test;
  35 
  36 import java.lang.invoke.MethodHandles;
  37 import java.lang.invoke.VarHandle;
  38 import java.util.ArrayList;
  39 import java.util.Arrays;
  40 import java.util.List;
  41 
  42 import static org.testng.Assert.*;
  43 
  44 public class VarHandleTestAccessShort extends VarHandleBaseTest {
  45     static final short static_final_v = (short)1;
  46 
  47     static short static_v;
  48 
  49     final short final_v = (short)1;
  50 
  51     short v;
  52 
  53     VarHandle vhFinalField;
  54 
  55     VarHandle vhField;
  56 
  57     VarHandle vhStaticField;
  58 
  59     VarHandle vhStaticFinalField;
  60 
  61     VarHandle vhArray;
  62 
  63     @BeforeClass
  64     public void setup() throws Exception {
  65         vhFinalField = MethodHandles.lookup().findVarHandle(
  66                 VarHandleTestAccessShort.class, "final_v", short.class);
  67 
  68         vhField = MethodHandles.lookup().findVarHandle(
  69                 VarHandleTestAccessShort.class, "v", short.class);


  82     public Object[][] varHandlesProvider() throws Exception {
  83         List<VarHandle> vhs = new ArrayList<>();
  84         vhs.add(vhField);
  85         vhs.add(vhStaticField);
  86         vhs.add(vhArray);
  87 
  88         return vhs.stream().map(tc -> new Object[]{tc}).toArray(Object[][]::new);
  89     }
  90 
  91     @Test(dataProvider = "varHandlesProvider")
  92     public void testIsAccessModeSupported(VarHandle vh) {
  93         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET));
  94         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET));
  95         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_VOLATILE));
  96         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_VOLATILE));
  97         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_ACQUIRE));
  98         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_RELEASE));
  99         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_OPAQUE));
 100         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 101 
 102         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
 103         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
 104         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
 105         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
 106         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
 107         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_VOLATILE));
 108         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
 109         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
 110         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));
 111 
 112         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
 113         assertFalse(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
 114     }
 115 
 116 
 117     @DataProvider
 118     public Object[][] typesProvider() throws Exception {
 119         List<Object[]> types = new ArrayList<>();
 120         types.add(new Object[] {vhField, Arrays.asList(VarHandleTestAccessShort.class)});
 121         types.add(new Object[] {vhStaticField, Arrays.asList()});
 122         types.add(new Object[] {vhArray, Arrays.asList(short[].class, int.class)});
 123 
 124         return types.stream().toArray(Object[][]::new);
 125     }
 126 
 127     @Test(dataProvider = "typesProvider")
 128     public void testTypes(VarHandle vh, List<Class<?>> pts) {
 129         assertEquals(vh.varType(), short.class);
 130 
 131         assertEquals(vh.coordinateTypes(), pts);
 132 
 133         testTypes(vh);


 203         // the first dummy argument
 204         return cases.stream().map(tc -> new Object[]{tc.toString(), tc}).toArray(Object[][]::new);
 205     }
 206 
 207     @Test(dataProvider = "accessTestCaseProvider")
 208     public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable {
 209         T t = atc.get();
 210         int iters = atc.requiresLoop() ? ITERS : 1;
 211         for (int c = 0; c < iters; c++) {
 212             atc.testAccess(t);
 213         }
 214     }
 215 
 216 
 217 
 218 
 219     static void testInstanceFinalField(VarHandleTestAccessShort recv, VarHandle vh) {
 220         // Plain
 221         {
 222             short x = (short) vh.get(recv);
 223             assertEquals(x, (short)1, "get short value");
 224         }
 225 
 226 
 227         // Volatile
 228         {
 229             short x = (short) vh.getVolatile(recv);
 230             assertEquals(x, (short)1, "getVolatile short value");
 231         }
 232 
 233         // Lazy
 234         {
 235             short x = (short) vh.getAcquire(recv);
 236             assertEquals(x, (short)1, "getRelease short value");
 237         }
 238 
 239         // Opaque
 240         {
 241             short x = (short) vh.getOpaque(recv);
 242             assertEquals(x, (short)1, "getOpaque short value");
 243         }
 244     }
 245 
 246     static void testInstanceFinalFieldUnsupported(VarHandleTestAccessShort recv, VarHandle vh) {
 247         checkUOE(() -> {
 248             vh.set(recv, (short)2);
 249         });
 250 
 251         checkUOE(() -> {
 252             vh.setVolatile(recv, (short)2);
 253         });
 254 
 255         checkUOE(() -> {
 256             vh.setRelease(recv, (short)2);
 257         });
 258 
 259         checkUOE(() -> {
 260             vh.setOpaque(recv, (short)2);
 261         });
 262 
 263         checkUOE(() -> {
 264             boolean r = vh.compareAndSet(recv, (short)1, (short)2);
 265         });
 266 
 267         checkUOE(() -> {
 268             short r = (short) vh.compareAndExchangeVolatile(recv, (short)1, (short)2);
 269         });
 270 
 271         checkUOE(() -> {
 272             short r = (short) vh.compareAndExchangeAcquire(recv, (short)1, (short)2);
 273         });
 274 
 275         checkUOE(() -> {
 276             short r = (short) vh.compareAndExchangeRelease(recv, (short)1, (short)2);
 277         });
 278 
 279         checkUOE(() -> {
 280             boolean r = vh.weakCompareAndSet(recv, (short)1, (short)2);
 281         });
 282 
 283         checkUOE(() -> {
 284             boolean r = vh.weakCompareAndSetVolatile(recv, (short)1, (short)2);
 285         });
 286 
 287         checkUOE(() -> {
 288             boolean r = vh.weakCompareAndSetAcquire(recv, (short)1, (short)2);
 289         });
 290 
 291         checkUOE(() -> {
 292             boolean r = vh.weakCompareAndSetRelease(recv, (short)1, (short)2);
 293         });
 294 
 295         checkUOE(() -> {
 296             short o = (short) vh.getAndAdd(recv, (short)1);
 297         });
 298 
 299         checkUOE(() -> {
 300             short o = (short) vh.addAndGet(recv, (short)1);
 301         });
 302     }
 303 
 304 
 305     static void testStaticFinalField(VarHandle vh) {
 306         // Plain
 307         {
 308             short x = (short) vh.get();
 309             assertEquals(x, (short)1, "get short value");
 310         }
 311 
 312 
 313         // Volatile
 314         {
 315             short x = (short) vh.getVolatile();
 316             assertEquals(x, (short)1, "getVolatile short value");
 317         }
 318 
 319         // Lazy
 320         {
 321             short x = (short) vh.getAcquire();
 322             assertEquals(x, (short)1, "getRelease short value");
 323         }
 324 
 325         // Opaque
 326         {
 327             short x = (short) vh.getOpaque();
 328             assertEquals(x, (short)1, "getOpaque short value");
 329         }
 330     }
 331 
 332     static void testStaticFinalFieldUnsupported(VarHandle vh) {
 333         checkUOE(() -> {
 334             vh.set((short)2);
 335         });
 336 
 337         checkUOE(() -> {
 338             vh.setVolatile((short)2);
 339         });
 340 
 341         checkUOE(() -> {
 342             vh.setRelease((short)2);
 343         });
 344 
 345         checkUOE(() -> {
 346             vh.setOpaque((short)2);
 347         });
 348 
 349         checkUOE(() -> {
 350             boolean r = vh.compareAndSet((short)1, (short)2);
 351         });
 352 
 353         checkUOE(() -> {
 354             short r = (short) vh.compareAndExchangeVolatile((short)1, (short)2);
 355         });
 356 
 357         checkUOE(() -> {
 358             short r = (short) vh.compareAndExchangeAcquire((short)1, (short)2);
 359         });
 360 
 361         checkUOE(() -> {
 362             short r = (short) vh.compareAndExchangeRelease((short)1, (short)2);
 363         });
 364 
 365         checkUOE(() -> {
 366             boolean r = vh.weakCompareAndSet((short)1, (short)2);
 367         });
 368 
 369         checkUOE(() -> {
 370             boolean r = vh.weakCompareAndSetVolatile((short)1, (short)2);
 371         });
 372 
 373         checkUOE(() -> {
 374             boolean r = vh.weakCompareAndSetAcquire((short)1, (short)2);
 375         });
 376 
 377         checkUOE(() -> {
 378             boolean r = vh.weakCompareAndSetRelease((short)1, (short)2);
 379         });
 380 
 381         checkUOE(() -> {
 382             short o = (short) vh.getAndAdd((short)1);
 383         });
 384 
 385         checkUOE(() -> {
 386             short o = (short) vh.addAndGet((short)1);
 387         });
 388     }
 389 
 390 
 391     static void testInstanceField(VarHandleTestAccessShort recv, VarHandle vh) {
 392         // Plain
 393         {
 394             vh.set(recv, (short)1);
 395             short x = (short) vh.get(recv);
 396             assertEquals(x, (short)1, "set short value");
 397         }
 398 
 399 
 400         // Volatile
 401         {
 402             vh.setVolatile(recv, (short)2);
 403             short x = (short) vh.getVolatile(recv);
 404             assertEquals(x, (short)2, "setVolatile short value");
 405         }
 406 
 407         // Lazy
 408         {
 409             vh.setRelease(recv, (short)1);
 410             short x = (short) vh.getAcquire(recv);
 411             assertEquals(x, (short)1, "setRelease short value");
 412         }
 413 
 414         // Opaque
 415         {
 416             vh.setOpaque(recv, (short)2);
 417             short x = (short) vh.getOpaque(recv);
 418             assertEquals(x, (short)2, "setOpaque short value");
 419         }
 420 

 421 






 422     }
 423 
 424     static void testInstanceFieldUnsupported(VarHandleTestAccessShort recv, VarHandle vh) {
 425         checkUOE(() -> {
 426             boolean r = vh.compareAndSet(recv, (short)1, (short)2);
 427         });


 428 
 429         checkUOE(() -> {
 430             short r = (short) vh.compareAndExchangeVolatile(recv, (short)1, (short)2);
 431         });



 432 
 433         checkUOE(() -> {
 434             short r = (short) vh.compareAndExchangeAcquire(recv, (short)1, (short)2);
 435         });



 436 
 437         checkUOE(() -> {
 438             short r = (short) vh.compareAndExchangeRelease(recv, (short)1, (short)2);
 439         });



 440 
 441         checkUOE(() -> {
 442             boolean r = vh.weakCompareAndSet(recv, (short)1, (short)2);
 443         });



 444 
 445         checkUOE(() -> {
 446             boolean r = vh.weakCompareAndSetVolatile(recv, (short)1, (short)2);
 447         });



 448 
 449         checkUOE(() -> {
 450             boolean r = vh.weakCompareAndSetAcquire(recv, (short)1, (short)2);
 451         });



 452 
 453         checkUOE(() -> {
 454             boolean r = vh.weakCompareAndSetRelease(recv, (short)1, (short)2);
 455         });






 456 
 457         checkUOE(() -> {
 458             short o = (short) vh.getAndAdd(recv, (short)1);
 459         });





































 460 
 461         checkUOE(() -> {
 462             short o = (short) vh.addAndGet(recv, (short)1);
 463         });
 464     }
 465 
 466 
 467     static void testStaticField(VarHandle vh) {
 468         // Plain
 469         {
 470             vh.set((short)1);
 471             short x = (short) vh.get();
 472             assertEquals(x, (short)1, "set short value");
 473         }
 474 
 475 
 476         // Volatile
 477         {
 478             vh.setVolatile((short)2);
 479             short x = (short) vh.getVolatile();
 480             assertEquals(x, (short)2, "setVolatile short value");
 481         }
 482 
 483         // Lazy
 484         {
 485             vh.setRelease((short)1);
 486             short x = (short) vh.getAcquire();
 487             assertEquals(x, (short)1, "setRelease short value");
 488         }
 489 
 490         // Opaque
 491         {
 492             vh.setOpaque((short)2);
 493             short x = (short) vh.getOpaque();
 494             assertEquals(x, (short)2, "setOpaque short value");
 495         }
 496 

 497 






 498     }
 499 
 500     static void testStaticFieldUnsupported(VarHandle vh) {
 501         checkUOE(() -> {
 502             boolean r = vh.compareAndSet((short)1, (short)2);
 503         });


 504 
 505         checkUOE(() -> {
 506             short r = (short) vh.compareAndExchangeVolatile((short)1, (short)2);
 507         });



 508 
 509         checkUOE(() -> {
 510             short r = (short) vh.compareAndExchangeAcquire((short)1, (short)2);
 511         });



 512 
 513         checkUOE(() -> {
 514             short r = (short) vh.compareAndExchangeRelease((short)1, (short)2);
 515         });



 516 
 517         checkUOE(() -> {
 518             boolean r = vh.weakCompareAndSet((short)1, (short)2);
 519         });



 520 
 521         checkUOE(() -> {
 522             boolean r = vh.weakCompareAndSetVolatile((short)1, (short)2);
 523         });



 524 
 525         checkUOE(() -> {
 526             boolean r = vh.weakCompareAndSetAcquire((short)1, (short)2);
 527         });



 528 
 529         checkUOE(() -> {
 530             boolean r = vh.weakCompareAndSetRelease((short)1, (short)2);
 531         });






 532 
 533         checkUOE(() -> {
 534             short o = (short) vh.getAndAdd((short)1);
 535         });





































 536 
 537         checkUOE(() -> {
 538             short o = (short) vh.addAndGet((short)1);
 539         });
 540     }
 541 
 542 
 543     static void testArray(VarHandle vh) {
 544         short[] array = new short[10];
 545 
 546         for (int i = 0; i < array.length; i++) {
 547             // Plain
 548             {
 549                 vh.set(array, i, (short)1);
 550                 short x = (short) vh.get(array, i);
 551                 assertEquals(x, (short)1, "get short value");
 552             }
 553 
 554 
 555             // Volatile
 556             {
 557                 vh.setVolatile(array, i, (short)2);
 558                 short x = (short) vh.getVolatile(array, i);
 559                 assertEquals(x, (short)2, "setVolatile short value");
 560             }
 561 
 562             // Lazy
 563             {
 564                 vh.setRelease(array, i, (short)1);
 565                 short x = (short) vh.getAcquire(array, i);
 566                 assertEquals(x, (short)1, "setRelease short value");
 567             }
 568 
 569             // Opaque
 570             {
 571                 vh.setOpaque(array, i, (short)2);
 572                 short x = (short) vh.getOpaque(array, i);
 573                 assertEquals(x, (short)2, "setOpaque short value");
 574             }
 575 

 576 






 577         }






 578     }
 579 
 580     static void testArrayUnsupported(VarHandle vh) {
 581         short[] array = new short[10];




 582 
 583         int i = 0;
 584         checkUOE(() -> {
 585             boolean r = vh.compareAndSet(array, i, (short)1, (short)2);
 586         });


 587 
 588         checkUOE(() -> {
 589             short r = (short) vh.compareAndExchangeVolatile(array, i, (short)1, (short)2);
 590         });



 591 
 592         checkUOE(() -> {
 593             short r = (short) vh.compareAndExchangeAcquire(array, i, (short)1, (short)2);
 594         });



 595 
 596         checkUOE(() -> {
 597             short r = (short) vh.compareAndExchangeRelease(array, i, (short)1, (short)2);
 598         });



 599 
 600         checkUOE(() -> {
 601             boolean r = vh.weakCompareAndSet(array, i, (short)1, (short)2);
 602         });



 603 
 604         checkUOE(() -> {
 605             boolean r = vh.weakCompareAndSetVolatile(array, i, (short)1, (short)2);
 606         });






 607 
 608         checkUOE(() -> {
 609             boolean r = vh.weakCompareAndSetAcquire(array, i, (short)1, (short)2);
 610         });






 611 
 612         checkUOE(() -> {
 613             boolean r = vh.weakCompareAndSetRelease(array, i, (short)1, (short)2);
 614         });






 615 
 616         checkUOE(() -> {
 617             short o = (short) vh.getAndAdd(array, i, (short)1);
 618         });





















 619 
 620         checkUOE(() -> {
 621             short o = (short) vh.addAndGet(array, i, (short)1);
 622         });
 623     }
 624 
 625     static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
 626         short[] array = new short[10];
 627 
 628         for (int i : new int[]{-1, Integer.MIN_VALUE, 10, 11, Integer.MAX_VALUE}) {
 629             final int ci = i;
 630 
 631             checkIOOBE(() -> {
 632                 short x = (short) vh.get(array, ci);
 633             });
 634 
 635             checkIOOBE(() -> {
 636                 vh.set(array, ci, (short)1);
 637             });
 638 
 639             checkIOOBE(() -> {
 640                 short x = (short) vh.getVolatile(array, ci);
 641             });
 642 
 643             checkIOOBE(() -> {
 644                 vh.setVolatile(array, ci, (short)1);
 645             });
 646 
 647             checkIOOBE(() -> {
 648                 short x = (short) vh.getAcquire(array, ci);
 649             });
 650 
 651             checkIOOBE(() -> {
 652                 vh.setRelease(array, ci, (short)1);
 653             });
 654 
 655             checkIOOBE(() -> {
 656                 short x = (short) vh.getOpaque(array, ci);
 657             });
 658 
 659             checkIOOBE(() -> {
 660                 vh.setOpaque(array, ci, (short)1);




























 661             });
 662 



 663 







 664         }
 665     }
 666 }
 667 


  25  * @test
  26  * @run testng/othervm -Diters=10    -Xint                   VarHandleTestAccessShort
  27  * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 VarHandleTestAccessShort
  28  * @run testng/othervm -Diters=20000                         VarHandleTestAccessShort
  29  * @run testng/othervm -Diters=20000 -XX:-TieredCompilation  VarHandleTestAccessShort
  30  */
  31 
  32 import org.testng.annotations.BeforeClass;
  33 import org.testng.annotations.DataProvider;
  34 import org.testng.annotations.Test;
  35 
  36 import java.lang.invoke.MethodHandles;
  37 import java.lang.invoke.VarHandle;
  38 import java.util.ArrayList;
  39 import java.util.Arrays;
  40 import java.util.List;
  41 
  42 import static org.testng.Assert.*;
  43 
  44 public class VarHandleTestAccessShort extends VarHandleBaseTest {
  45     static final short static_final_v = (short)0x0123;
  46 
  47     static short static_v;
  48 
  49     final short final_v = (short)0x0123;
  50 
  51     short v;
  52 
  53     VarHandle vhFinalField;
  54 
  55     VarHandle vhField;
  56 
  57     VarHandle vhStaticField;
  58 
  59     VarHandle vhStaticFinalField;
  60 
  61     VarHandle vhArray;
  62 
  63     @BeforeClass
  64     public void setup() throws Exception {
  65         vhFinalField = MethodHandles.lookup().findVarHandle(
  66                 VarHandleTestAccessShort.class, "final_v", short.class);
  67 
  68         vhField = MethodHandles.lookup().findVarHandle(
  69                 VarHandleTestAccessShort.class, "v", short.class);


  82     public Object[][] varHandlesProvider() throws Exception {
  83         List<VarHandle> vhs = new ArrayList<>();
  84         vhs.add(vhField);
  85         vhs.add(vhStaticField);
  86         vhs.add(vhArray);
  87 
  88         return vhs.stream().map(tc -> new Object[]{tc}).toArray(Object[][]::new);
  89     }
  90 
  91     @Test(dataProvider = "varHandlesProvider")
  92     public void testIsAccessModeSupported(VarHandle vh) {
  93         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET));
  94         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET));
  95         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_VOLATILE));
  96         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_VOLATILE));
  97         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_ACQUIRE));
  98         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_RELEASE));
  99         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_OPAQUE));
 100         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.SET_OPAQUE));
 101 
 102         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_SET));
 103         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_VOLATILE));
 104         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_ACQUIRE));
 105         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.COMPARE_AND_EXCHANGE_RELEASE));
 106         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET));
 107         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_ACQUIRE));
 108         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.WEAK_COMPARE_AND_SET_RELEASE));
 109         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_SET));

 110 
 111         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.GET_AND_ADD));
 112         assertTrue(vh.isAccessModeSupported(VarHandle.AccessMode.ADD_AND_GET));
 113     }
 114 
 115 
 116     @DataProvider
 117     public Object[][] typesProvider() throws Exception {
 118         List<Object[]> types = new ArrayList<>();
 119         types.add(new Object[] {vhField, Arrays.asList(VarHandleTestAccessShort.class)});
 120         types.add(new Object[] {vhStaticField, Arrays.asList()});
 121         types.add(new Object[] {vhArray, Arrays.asList(short[].class, int.class)});
 122 
 123         return types.stream().toArray(Object[][]::new);
 124     }
 125 
 126     @Test(dataProvider = "typesProvider")
 127     public void testTypes(VarHandle vh, List<Class<?>> pts) {
 128         assertEquals(vh.varType(), short.class);
 129 
 130         assertEquals(vh.coordinateTypes(), pts);
 131 
 132         testTypes(vh);


 202         // the first dummy argument
 203         return cases.stream().map(tc -> new Object[]{tc.toString(), tc}).toArray(Object[][]::new);
 204     }
 205 
 206     @Test(dataProvider = "accessTestCaseProvider")
 207     public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable {
 208         T t = atc.get();
 209         int iters = atc.requiresLoop() ? ITERS : 1;
 210         for (int c = 0; c < iters; c++) {
 211             atc.testAccess(t);
 212         }
 213     }
 214 
 215 
 216 
 217 
 218     static void testInstanceFinalField(VarHandleTestAccessShort recv, VarHandle vh) {
 219         // Plain
 220         {
 221             short x = (short) vh.get(recv);
 222             assertEquals(x, (short)0x0123, "get short value");
 223         }
 224 
 225 
 226         // Volatile
 227         {
 228             short x = (short) vh.getVolatile(recv);
 229             assertEquals(x, (short)0x0123, "getVolatile short value");
 230         }
 231 
 232         // Lazy
 233         {
 234             short x = (short) vh.getAcquire(recv);
 235             assertEquals(x, (short)0x0123, "getRelease short value");
 236         }
 237 
 238         // Opaque
 239         {
 240             short x = (short) vh.getOpaque(recv);
 241             assertEquals(x, (short)0x0123, "getOpaque short value");
 242         }
 243     }
 244 
 245     static void testInstanceFinalFieldUnsupported(VarHandleTestAccessShort recv, VarHandle vh) {
 246         checkUOE(() -> {
 247             vh.set(recv, (short)0x4567);
 248         });
 249 
 250         checkUOE(() -> {
 251             vh.setVolatile(recv, (short)0x4567);
 252         });
 253 
 254         checkUOE(() -> {
 255             vh.setRelease(recv, (short)0x4567);
 256         });
 257 
 258         checkUOE(() -> {
 259             vh.setOpaque(recv, (short)0x4567);
 260         });
 261 







 262 































 263     }
 264 
 265 
 266     static void testStaticFinalField(VarHandle vh) {
 267         // Plain
 268         {
 269             short x = (short) vh.get();
 270             assertEquals(x, (short)0x0123, "get short value");
 271         }
 272 
 273 
 274         // Volatile
 275         {
 276             short x = (short) vh.getVolatile();
 277             assertEquals(x, (short)0x0123, "getVolatile short value");
 278         }
 279 
 280         // Lazy
 281         {
 282             short x = (short) vh.getAcquire();
 283             assertEquals(x, (short)0x0123, "getRelease short value");
 284         }
 285 
 286         // Opaque
 287         {
 288             short x = (short) vh.getOpaque();
 289             assertEquals(x, (short)0x0123, "getOpaque short value");
 290         }
 291     }
 292 
 293     static void testStaticFinalFieldUnsupported(VarHandle vh) {
 294         checkUOE(() -> {
 295             vh.set((short)0x4567);
 296         });
 297 
 298         checkUOE(() -> {
 299             vh.setVolatile((short)0x4567);
 300         });
 301 
 302         checkUOE(() -> {
 303             vh.setRelease((short)0x4567);
 304         });
 305 
 306         checkUOE(() -> {
 307             vh.setOpaque((short)0x4567);
 308         });
 309 







 310 































 311     }
 312 
 313 
 314     static void testInstanceField(VarHandleTestAccessShort recv, VarHandle vh) {
 315         // Plain
 316         {
 317             vh.set(recv, (short)0x0123);
 318             short x = (short) vh.get(recv);
 319             assertEquals(x, (short)0x0123, "set short value");
 320         }
 321 
 322 
 323         // Volatile
 324         {
 325             vh.setVolatile(recv, (short)0x4567);
 326             short x = (short) vh.getVolatile(recv);
 327             assertEquals(x, (short)0x4567, "setVolatile short value");
 328         }
 329 
 330         // Lazy
 331         {
 332             vh.setRelease(recv, (short)0x0123);
 333             short x = (short) vh.getAcquire(recv);
 334             assertEquals(x, (short)0x0123, "setRelease short value");
 335         }
 336 
 337         // Opaque
 338         {
 339             vh.setOpaque(recv, (short)0x4567);
 340             short x = (short) vh.getOpaque(recv);
 341             assertEquals(x, (short)0x4567, "setOpaque short value");
 342         }
 343 
 344         vh.set(recv, (short)0x0123);
 345 
 346         // Compare
 347         {
 348             boolean r = vh.compareAndSet(recv, (short)0x0123, (short)0x4567);
 349             assertEquals(r, true, "success compareAndSet short");
 350             short x = (short) vh.get(recv);
 351             assertEquals(x, (short)0x4567, "success compareAndSet short value");
 352         }
 353 
 354         {
 355             boolean r = vh.compareAndSet(recv, (short)0x0123, (short)0x89AB);
 356             assertEquals(r, false, "failing compareAndSet short");
 357             short x = (short) vh.get(recv);
 358             assertEquals(x, (short)0x4567, "failing compareAndSet short value");
 359         }
 360 
 361         {
 362             short r = (short) vh.compareAndExchangeVolatile(recv, (short)0x4567, (short)0x0123);
 363             assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
 364             short x = (short) vh.get(recv);
 365             assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
 366         }
 367 
 368         {
 369             short r = (short) vh.compareAndExchangeVolatile(recv, (short)0x4567, (short)0x89AB);
 370             assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
 371             short x = (short) vh.get(recv);
 372             assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
 373         }
 374 
 375         {
 376             short r = (short) vh.compareAndExchangeAcquire(recv, (short)0x0123, (short)0x4567);
 377             assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
 378             short x = (short) vh.get(recv);
 379             assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
 380         }
 381 
 382         {
 383             short r = (short) vh.compareAndExchangeAcquire(recv, (short)0x0123, (short)0x89AB);
 384             assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
 385             short x = (short) vh.get(recv);
 386             assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
 387         }
 388 
 389         {
 390             short r = (short) vh.compareAndExchangeRelease(recv, (short)0x4567, (short)0x0123);
 391             assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
 392             short x = (short) vh.get(recv);
 393             assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
 394         }
 395 
 396         {
 397             short r = (short) vh.compareAndExchangeRelease(recv, (short)0x4567, (short)0x89AB);
 398             assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
 399             short x = (short) vh.get(recv);
 400             assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
 401         }
 402 
 403         {
 404             boolean success = false;
 405             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 406                 success = vh.weakCompareAndSet(recv, (short)0x0123, (short)0x4567);
 407             }
 408             assertEquals(success, true, "weakCompareAndSet short");
 409             short x = (short) vh.get(recv);
 410             assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
 411         }
 412 
 413         {
 414             boolean success = false;
 415             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 416                 success = vh.weakCompareAndSetAcquire(recv, (short)0x4567, (short)0x0123);
 417             }
 418             assertEquals(success, true, "weakCompareAndSetAcquire short");
 419             short x = (short) vh.get(recv);
 420             assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
 421         }
 422 
 423         {
 424             boolean success = false;
 425             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 426                 success = vh.weakCompareAndSetRelease(recv, (short)0x0123, (short)0x4567);
 427             }
 428             assertEquals(success, true, "weakCompareAndSetRelease short");
 429             short x = (short) vh.get(recv);
 430             assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
 431         }
 432 
 433         // Compare set and get
 434         {
 435             short o = (short) vh.getAndSet(recv, (short)0x0123);
 436             assertEquals(o, (short)0x4567, "getAndSet short");
 437             short x = (short) vh.get(recv);
 438             assertEquals(x, (short)0x0123, "getAndSet short value");
 439         }
 440 
 441         vh.set(recv, (short)0x0123);
 442 
 443         // get and add, add and get
 444         {
 445             short o = (short) vh.getAndAdd(recv, (short)0x89AB);
 446             assertEquals(o, (short)0x0123, "getAndAdd short");
 447             short c = (short) vh.addAndGet(recv, (short)0x89AB);
 448             assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
 449         }
 450     }
 451 
 452     static void testInstanceFieldUnsupported(VarHandleTestAccessShort recv, VarHandle vh) {
 453 



 454     }
 455 
 456 
 457     static void testStaticField(VarHandle vh) {
 458         // Plain
 459         {
 460             vh.set((short)0x0123);
 461             short x = (short) vh.get();
 462             assertEquals(x, (short)0x0123, "set short value");
 463         }
 464 
 465 
 466         // Volatile
 467         {
 468             vh.setVolatile((short)0x4567);
 469             short x = (short) vh.getVolatile();
 470             assertEquals(x, (short)0x4567, "setVolatile short value");
 471         }
 472 
 473         // Lazy
 474         {
 475             vh.setRelease((short)0x0123);
 476             short x = (short) vh.getAcquire();
 477             assertEquals(x, (short)0x0123, "setRelease short value");
 478         }
 479 
 480         // Opaque
 481         {
 482             vh.setOpaque((short)0x4567);
 483             short x = (short) vh.getOpaque();
 484             assertEquals(x, (short)0x4567, "setOpaque short value");
 485         }
 486 
 487         vh.set((short)0x0123);
 488 
 489         // Compare
 490         {
 491             boolean r = vh.compareAndSet((short)0x0123, (short)0x4567);
 492             assertEquals(r, true, "success compareAndSet short");
 493             short x = (short) vh.get();
 494             assertEquals(x, (short)0x4567, "success compareAndSet short value");
 495         }
 496 
 497         {
 498             boolean r = vh.compareAndSet((short)0x0123, (short)0x89AB);
 499             assertEquals(r, false, "failing compareAndSet short");
 500             short x = (short) vh.get();
 501             assertEquals(x, (short)0x4567, "failing compareAndSet short value");
 502         }
 503 
 504         {
 505             short r = (short) vh.compareAndExchangeVolatile((short)0x4567, (short)0x0123);
 506             assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
 507             short x = (short) vh.get();
 508             assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
 509         }
 510 
 511         {
 512             short r = (short) vh.compareAndExchangeVolatile((short)0x4567, (short)0x89AB);
 513             assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
 514             short x = (short) vh.get();
 515             assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
 516         }
 517 
 518         {
 519             short r = (short) vh.compareAndExchangeAcquire((short)0x0123, (short)0x4567);
 520             assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
 521             short x = (short) vh.get();
 522             assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
 523         }
 524 
 525         {
 526             short r = (short) vh.compareAndExchangeAcquire((short)0x0123, (short)0x89AB);
 527             assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
 528             short x = (short) vh.get();
 529             assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
 530         }
 531 
 532         {
 533             short r = (short) vh.compareAndExchangeRelease((short)0x4567, (short)0x0123);
 534             assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
 535             short x = (short) vh.get();
 536             assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
 537         }
 538 
 539         {
 540             short r = (short) vh.compareAndExchangeRelease((short)0x4567, (short)0x89AB);
 541             assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
 542             short x = (short) vh.get();
 543             assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
 544         }
 545 
 546         {
 547             boolean success = false;
 548             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 549                 success = vh.weakCompareAndSet((short)0x0123, (short)0x4567);
 550             }
 551             assertEquals(success, true, "weakCompareAndSet short");
 552             short x = (short) vh.get();
 553             assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
 554         }
 555 
 556         {
 557             boolean success = false;
 558             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 559                 success = vh.weakCompareAndSetAcquire((short)0x4567, (short)0x0123);
 560             }
 561             assertEquals(success, true, "weakCompareAndSetAcquire short");
 562             short x = (short) vh.get();
 563             assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
 564         }
 565 
 566         {
 567             boolean success = false;
 568             for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 569                 success = vh.weakCompareAndSetRelease((short)0x0123, (short)0x4567);
 570             }
 571             assertEquals(success, true, "weakCompareAndSetRelease short");
 572             short x = (short) vh.get();
 573             assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
 574         }
 575 
 576         // Compare set and get
 577         {
 578             short o = (short) vh.getAndSet( (short)0x0123);
 579             assertEquals(o, (short)0x4567, "getAndSet short");
 580             short x = (short) vh.get();
 581             assertEquals(x, (short)0x0123, "getAndSet short value");
 582         }
 583 
 584         vh.set((short)0x0123);
 585 
 586         // get and add, add and get
 587         {
 588             short o = (short) vh.getAndAdd( (short)0x89AB);
 589             assertEquals(o, (short)0x0123, "getAndAdd short");
 590             short c = (short) vh.addAndGet((short)0x89AB);
 591             assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
 592         }
 593     }
 594 
 595     static void testStaticFieldUnsupported(VarHandle vh) {
 596 



 597     }
 598 
 599 
 600     static void testArray(VarHandle vh) {
 601         short[] array = new short[10];
 602 
 603         for (int i = 0; i < array.length; i++) {
 604             // Plain
 605             {
 606                 vh.set(array, i, (short)0x0123);
 607                 short x = (short) vh.get(array, i);
 608                 assertEquals(x, (short)0x0123, "get short value");
 609             }
 610 
 611 
 612             // Volatile
 613             {
 614                 vh.setVolatile(array, i, (short)0x4567);
 615                 short x = (short) vh.getVolatile(array, i);
 616                 assertEquals(x, (short)0x4567, "setVolatile short value");
 617             }
 618 
 619             // Lazy
 620             {
 621                 vh.setRelease(array, i, (short)0x0123);
 622                 short x = (short) vh.getAcquire(array, i);
 623                 assertEquals(x, (short)0x0123, "setRelease short value");
 624             }
 625 
 626             // Opaque
 627             {
 628                 vh.setOpaque(array, i, (short)0x4567);
 629                 short x = (short) vh.getOpaque(array, i);
 630                 assertEquals(x, (short)0x4567, "setOpaque short value");
 631             }
 632 
 633             vh.set(array, i, (short)0x0123);
 634 
 635             // Compare
 636             {
 637                 boolean r = vh.compareAndSet(array, i, (short)0x0123, (short)0x4567);
 638                 assertEquals(r, true, "success compareAndSet short");
 639                 short x = (short) vh.get(array, i);
 640                 assertEquals(x, (short)0x4567, "success compareAndSet short value");
 641             }
 642 
 643             {
 644                 boolean r = vh.compareAndSet(array, i, (short)0x0123, (short)0x89AB);
 645                 assertEquals(r, false, "failing compareAndSet short");
 646                 short x = (short) vh.get(array, i);
 647                 assertEquals(x, (short)0x4567, "failing compareAndSet short value");
 648             }
 649 
 650             {
 651                 short r = (short) vh.compareAndExchangeVolatile(array, i, (short)0x4567, (short)0x0123);
 652                 assertEquals(r, (short)0x4567, "success compareAndExchangeVolatile short");
 653                 short x = (short) vh.get(array, i);
 654                 assertEquals(x, (short)0x0123, "success compareAndExchangeVolatile short value");
 655             }
 656 
 657             {
 658                 short r = (short) vh.compareAndExchangeVolatile(array, i, (short)0x4567, (short)0x89AB);
 659                 assertEquals(r, (short)0x0123, "failing compareAndExchangeVolatile short");
 660                 short x = (short) vh.get(array, i);
 661                 assertEquals(x, (short)0x0123, "failing compareAndExchangeVolatile short value");
 662             }
 663 
 664             {
 665                 short r = (short) vh.compareAndExchangeAcquire(array, i, (short)0x0123, (short)0x4567);
 666                 assertEquals(r, (short)0x0123, "success compareAndExchangeAcquire short");
 667                 short x = (short) vh.get(array, i);
 668                 assertEquals(x, (short)0x4567, "success compareAndExchangeAcquire short value");
 669             }
 670 
 671             {
 672                 short r = (short) vh.compareAndExchangeAcquire(array, i, (short)0x0123, (short)0x89AB);
 673                 assertEquals(r, (short)0x4567, "failing compareAndExchangeAcquire short");
 674                 short x = (short) vh.get(array, i);
 675                 assertEquals(x, (short)0x4567, "failing compareAndExchangeAcquire short value");
 676             }
 677 
 678             {
 679                 short r = (short) vh.compareAndExchangeRelease(array, i, (short)0x4567, (short)0x0123);
 680                 assertEquals(r, (short)0x4567, "success compareAndExchangeRelease short");
 681                 short x = (short) vh.get(array, i);
 682                 assertEquals(x, (short)0x0123, "success compareAndExchangeRelease short value");
 683             }
 684 
 685             {
 686                 short r = (short) vh.compareAndExchangeRelease(array, i, (short)0x4567, (short)0x89AB);
 687                 assertEquals(r, (short)0x0123, "failing compareAndExchangeRelease short");
 688                 short x = (short) vh.get(array, i);
 689                 assertEquals(x, (short)0x0123, "failing compareAndExchangeRelease short value");
 690             }
 691 
 692             {
 693                 boolean success = false;
 694                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 695                     success = vh.weakCompareAndSet(array, i, (short)0x0123, (short)0x4567);
 696                 }
 697                 assertEquals(success, true, "weakCompareAndSet short");
 698                 short x = (short) vh.get(array, i);
 699                 assertEquals(x, (short)0x4567, "weakCompareAndSet short value");
 700             }
 701 
 702             {
 703                 boolean success = false;
 704                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 705                     success = vh.weakCompareAndSetAcquire(array, i, (short)0x4567, (short)0x0123);
 706                 }
 707                 assertEquals(success, true, "weakCompareAndSetAcquire short");
 708                 short x = (short) vh.get(array, i);
 709                 assertEquals(x, (short)0x0123, "weakCompareAndSetAcquire short");
 710             }
 711 
 712             {
 713                 boolean success = false;
 714                 for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
 715                     success = vh.weakCompareAndSetRelease(array, i, (short)0x0123, (short)0x4567);
 716                 }
 717                 assertEquals(success, true, "weakCompareAndSetRelease short");
 718                 short x = (short) vh.get(array, i);
 719                 assertEquals(x, (short)0x4567, "weakCompareAndSetRelease short");
 720             }
 721 
 722             // Compare set and get
 723             {
 724                 short o = (short) vh.getAndSet(array, i, (short)0x0123);
 725                 assertEquals(o, (short)0x4567, "getAndSet short");
 726                 short x = (short) vh.get(array, i);
 727                 assertEquals(x, (short)0x0123, "getAndSet short value");
 728             }
 729 
 730             vh.set(array, i, (short)0x0123);
 731 
 732             // get and add, add and get
 733             {
 734                 short o = (short) vh.getAndAdd(array, i, (short)0x89AB);
 735                 assertEquals(o, (short)0x0123, "getAndAdd short");
 736                 short c = (short) vh.addAndGet(array, i, (short)0x89AB);
 737                 assertEquals(c, (short)((short)0x0123 + (short)0x89AB + (short)0x89AB), "getAndAdd short value");
 738             }
 739         }
 740     }
 741 
 742     static void testArrayUnsupported(VarHandle vh) {
 743         short[] array = new short[10];
 744 
 745         int i = 0;
 746 



 747     }
 748 
 749     static void testArrayIndexOutOfBounds(VarHandle vh) throws Throwable {
 750         short[] array = new short[10];
 751 
 752         for (int i : new int[]{-1, Integer.MIN_VALUE, 10, 11, Integer.MAX_VALUE}) {
 753             final int ci = i;
 754 
 755             checkIOOBE(() -> {
 756                 short x = (short) vh.get(array, ci);
 757             });
 758 
 759             checkIOOBE(() -> {
 760                 vh.set(array, ci, (short)0x0123);
 761             });
 762 
 763             checkIOOBE(() -> {
 764                 short x = (short) vh.getVolatile(array, ci);
 765             });
 766 
 767             checkIOOBE(() -> {
 768                 vh.setVolatile(array, ci, (short)0x0123);
 769             });
 770 
 771             checkIOOBE(() -> {
 772                 short x = (short) vh.getAcquire(array, ci);
 773             });
 774 
 775             checkIOOBE(() -> {
 776                 vh.setRelease(array, ci, (short)0x0123);
 777             });
 778 
 779             checkIOOBE(() -> {
 780                 short x = (short) vh.getOpaque(array, ci);
 781             });
 782 
 783             checkIOOBE(() -> {
 784                 vh.setOpaque(array, ci, (short)0x0123);
 785             });
 786 
 787             checkIOOBE(() -> {
 788                 boolean r = vh.compareAndSet(array, ci, (short)0x0123, (short)0x4567);
 789             });
 790 
 791             checkIOOBE(() -> {
 792                 short r = (short) vh.compareAndExchangeVolatile(array, ci, (short)0x4567, (short)0x0123);
 793             });
 794 
 795             checkIOOBE(() -> {
 796                 short r = (short) vh.compareAndExchangeAcquire(array, ci, (short)0x4567, (short)0x0123);
 797             });
 798 
 799             checkIOOBE(() -> {
 800                 short r = (short) vh.compareAndExchangeRelease(array, ci, (short)0x4567, (short)0x0123);
 801             });
 802 
 803             checkIOOBE(() -> {
 804                 boolean r = vh.weakCompareAndSet(array, ci, (short)0x0123, (short)0x4567);
 805             });
 806 
 807             checkIOOBE(() -> {
 808                 boolean r = vh.weakCompareAndSetAcquire(array, ci, (short)0x0123, (short)0x4567);
 809             });
 810 
 811             checkIOOBE(() -> {
 812                 boolean r = vh.weakCompareAndSetRelease(array, ci, (short)0x0123, (short)0x4567);
 813             });
 814 
 815             checkIOOBE(() -> {
 816                 short o = (short) vh.getAndSet(array, ci, (short)0x0123);
 817             });
 818 
 819             checkIOOBE(() -> {
 820                 short o = (short) vh.getAndAdd(array, ci, (short)0x89AB);
 821             });
 822 
 823             checkIOOBE(() -> {
 824                 short o = (short) vh.addAndGet(array, ci, (short)0x89AB);
 825             });
 826         }
 827     }
 828 }
 829 
< prev index next >