1 /* 2 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 #warn 25 26 #if[Value] 27 /* 28 * @test 29 * @bug 8156486 8207257 30 * @run testng/othervm -XX:+EnableValhalla VarHandleTestMethodType$Type$ 31 * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false 32 * -XX:+EnableValhalla VarHandleTestMethodType$Type$ 33 */ 34 #else[Value] 35 /* 36 * @test 37 * @bug 8156486 8207257 38 * @run testng/othervm VarHandleTestMethodType$Type$ 39 * @run testng/othervm -Djava.lang.invoke.VarHandle.VAR_HANDLE_GUARDS=false VarHandleTestMethodType$Type$ 40 */ 41 #end[Value] 42 43 import org.testng.annotations.BeforeClass; 44 import org.testng.annotations.DataProvider; 45 import org.testng.annotations.Test; 46 47 import java.lang.invoke.MethodHandles; 48 import java.lang.invoke.VarHandle; 49 import java.util.ArrayList; 50 import java.util.Arrays; 51 import java.util.List; 52 53 import static org.testng.Assert.*; 54 55 import static java.lang.invoke.MethodType.*; 56 57 public class VarHandleTestMethodType$Type$ extends VarHandleBaseTest { 58 static final $type$ static_final_v = $value1$; 59 60 static $type$ static_v = $value1$; 61 62 final $type$ final_v = $value1$; 63 64 $type$ v = $value1$; 65 66 VarHandle vhFinalField; 67 68 VarHandle vhField; 69 70 VarHandle vhStaticField; 71 72 VarHandle vhStaticFinalField; 73 74 VarHandle vhArray; 75 76 @BeforeClass 77 public void setup() throws Exception { 78 vhFinalField = MethodHandles.lookup().findVarHandle( 79 VarHandleTestMethodType$Type$.class, "final_v", $type$.class); 80 81 vhField = MethodHandles.lookup().findVarHandle( 82 VarHandleTestMethodType$Type$.class, "v", $type$.class); 83 84 vhStaticFinalField = MethodHandles.lookup().findStaticVarHandle( 85 VarHandleTestMethodType$Type$.class, "static_final_v", $type$.class); 86 87 vhStaticField = MethodHandles.lookup().findStaticVarHandle( 88 VarHandleTestMethodType$Type$.class, "static_v", $type$.class); 89 90 vhArray = MethodHandles.arrayElementVarHandle($type$[].class); 91 } 92 93 @DataProvider 94 public Object[][] accessTestCaseProvider() throws Exception { 95 List<AccessTestCase<?>> cases = new ArrayList<>(); 96 97 cases.add(new VarHandleAccessTestCase("Instance field", 98 vhField, vh -> testInstanceFieldWrongMethodType(this, vh), 99 false)); 100 101 cases.add(new VarHandleAccessTestCase("Static field", 102 vhStaticField, VarHandleTestMethodType$Type$::testStaticFieldWrongMethodType, 103 false)); 104 105 cases.add(new VarHandleAccessTestCase("Array", 106 vhArray, VarHandleTestMethodType$Type$::testArrayWrongMethodType, 107 false)); 108 109 for (VarHandleToMethodHandle f : VarHandleToMethodHandle.values()) { 110 cases.add(new MethodHandleAccessTestCase("Instance field", 111 vhField, f, hs -> testInstanceFieldWrongMethodType(this, hs), 112 false)); 113 114 cases.add(new MethodHandleAccessTestCase("Static field", 115 vhStaticField, f, VarHandleTestMethodType$Type$::testStaticFieldWrongMethodType, 116 false)); 117 118 cases.add(new MethodHandleAccessTestCase("Array", 119 vhArray, f, VarHandleTestMethodType$Type$::testArrayWrongMethodType, 120 false)); 121 } 122 // Work around issue with jtreg summary reporting which truncates 123 // the String result of Object.toString to 30 characters, hence 124 // the first dummy argument 125 return cases.stream().map(tc -> new Object[]{tc.toString(), tc}).toArray(Object[][]::new); 126 } 127 128 @Test(dataProvider = "accessTestCaseProvider") 129 public <T> void testAccess(String desc, AccessTestCase<T> atc) throws Throwable { 130 T t = atc.get(); 131 int iters = atc.requiresLoop() ? ITERS : 1; 132 for (int c = 0; c < iters; c++) { 133 atc.testAccess(t); 134 } 135 } 136 137 138 static void testInstanceFieldWrongMethodType(VarHandleTestMethodType$Type$ recv, VarHandle vh) throws Throwable { 139 // Get 140 // Incorrect argument types 141 checkNPE(() -> { // null receiver 142 $type$ x = ($type$) vh.get(null); 143 }); 144 checkCCE(() -> { // receiver reference class 145 $type$ x = ($type$) vh.get(Void.class); 146 }); 147 checkWMTE(() -> { // receiver primitive class 148 $type$ x = ($type$) vh.get(0); 149 }); 150 // Incorrect return type 151 check{#if[Class]?CCE:WMTE}(() -> { // reference class 152 Void x = (Void) vh.get(recv); 153 }); 154 checkWMTE(() -> { // primitive class 155 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.get(recv); 156 }); 157 // Incorrect arity 158 checkWMTE(() -> { // 0 159 $type$ x = ($type$) vh.get(); 160 }); 161 checkWMTE(() -> { // > 162 $type$ x = ($type$) vh.get(recv, Void.class); 163 }); 164 165 166 // Set 167 // Incorrect argument types 168 checkNPE(() -> { // null receiver 169 vh.set(null, $value1$); 170 }); 171 checkCCE(() -> { // receiver reference class 172 vh.set(Void.class, $value1$); 173 }); 174 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 175 vh.set(recv, Void.class); 176 }); 177 checkWMTE(() -> { // receiver primitive class 178 vh.set(0, $value1$); 179 }); 180 // Incorrect arity 181 checkWMTE(() -> { // 0 182 vh.set(); 183 }); 184 checkWMTE(() -> { // > 185 vh.set(recv, $value1$, Void.class); 186 }); 187 188 189 // GetVolatile 190 // Incorrect argument types 191 checkNPE(() -> { // null receiver 192 $type$ x = ($type$) vh.getVolatile(null); 193 }); 194 checkCCE(() -> { // receiver reference class 195 $type$ x = ($type$) vh.getVolatile(Void.class); 196 }); 197 checkWMTE(() -> { // receiver primitive class 198 $type$ x = ($type$) vh.getVolatile(0); 199 }); 200 // Incorrect return type 201 check{#if[Class]?CCE:WMTE}(() -> { // reference class 202 Void x = (Void) vh.getVolatile(recv); 203 }); 204 checkWMTE(() -> { // primitive class 205 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getVolatile(recv); 206 }); 207 // Incorrect arity 208 checkWMTE(() -> { // 0 209 $type$ x = ($type$) vh.getVolatile(); 210 }); 211 checkWMTE(() -> { // > 212 $type$ x = ($type$) vh.getVolatile(recv, Void.class); 213 }); 214 215 216 // SetVolatile 217 // Incorrect argument types 218 checkNPE(() -> { // null receiver 219 vh.setVolatile(null, $value1$); 220 }); 221 checkCCE(() -> { // receiver reference class 222 vh.setVolatile(Void.class, $value1$); 223 }); 224 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 225 vh.setVolatile(recv, Void.class); 226 }); 227 checkWMTE(() -> { // receiver primitive class 228 vh.setVolatile(0, $value1$); 229 }); 230 // Incorrect arity 231 checkWMTE(() -> { // 0 232 vh.setVolatile(); 233 }); 234 checkWMTE(() -> { // > 235 vh.setVolatile(recv, $value1$, Void.class); 236 }); 237 238 239 // GetOpaque 240 // Incorrect argument types 241 checkNPE(() -> { // null receiver 242 $type$ x = ($type$) vh.getOpaque(null); 243 }); 244 checkCCE(() -> { // receiver reference class 245 $type$ x = ($type$) vh.getOpaque(Void.class); 246 }); 247 checkWMTE(() -> { // receiver primitive class 248 $type$ x = ($type$) vh.getOpaque(0); 249 }); 250 // Incorrect return type 251 check{#if[Class]?CCE:WMTE}(() -> { // reference class 252 Void x = (Void) vh.getOpaque(recv); 253 }); 254 checkWMTE(() -> { // primitive class 255 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getOpaque(recv); 256 }); 257 // Incorrect arity 258 checkWMTE(() -> { // 0 259 $type$ x = ($type$) vh.getOpaque(); 260 }); 261 checkWMTE(() -> { // > 262 $type$ x = ($type$) vh.getOpaque(recv, Void.class); 263 }); 264 265 266 // SetOpaque 267 // Incorrect argument types 268 checkNPE(() -> { // null receiver 269 vh.setOpaque(null, $value1$); 270 }); 271 checkCCE(() -> { // receiver reference class 272 vh.setOpaque(Void.class, $value1$); 273 }); 274 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 275 vh.setOpaque(recv, Void.class); 276 }); 277 checkWMTE(() -> { // receiver primitive class 278 vh.setOpaque(0, $value1$); 279 }); 280 // Incorrect arity 281 checkWMTE(() -> { // 0 282 vh.setOpaque(); 283 }); 284 checkWMTE(() -> { // > 285 vh.setOpaque(recv, $value1$, Void.class); 286 }); 287 288 289 // GetAcquire 290 // Incorrect argument types 291 checkNPE(() -> { // null receiver 292 $type$ x = ($type$) vh.getAcquire(null); 293 }); 294 checkCCE(() -> { // receiver reference class 295 $type$ x = ($type$) vh.getAcquire(Void.class); 296 }); 297 checkWMTE(() -> { // receiver primitive class 298 $type$ x = ($type$) vh.getAcquire(0); 299 }); 300 // Incorrect return type 301 check{#if[Class]?CCE:WMTE}(() -> { // reference class 302 Void x = (Void) vh.getAcquire(recv); 303 }); 304 checkWMTE(() -> { // primitive class 305 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAcquire(recv); 306 }); 307 // Incorrect arity 308 checkWMTE(() -> { // 0 309 $type$ x = ($type$) vh.getAcquire(); 310 }); 311 checkWMTE(() -> { // > 312 $type$ x = ($type$) vh.getAcquire(recv, Void.class); 313 }); 314 315 316 // SetRelease 317 // Incorrect argument types 318 checkNPE(() -> { // null receiver 319 vh.setRelease(null, $value1$); 320 }); 321 checkCCE(() -> { // receiver reference class 322 vh.setRelease(Void.class, $value1$); 323 }); 324 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 325 vh.setRelease(recv, Void.class); 326 }); 327 checkWMTE(() -> { // receiver primitive class 328 vh.setRelease(0, $value1$); 329 }); 330 // Incorrect arity 331 checkWMTE(() -> { // 0 332 vh.setRelease(); 333 }); 334 checkWMTE(() -> { // > 335 vh.setRelease(recv, $value1$, Void.class); 336 }); 337 338 339 #if[CAS] 340 // CompareAndSet 341 // Incorrect argument types 342 checkNPE(() -> { // null receiver 343 boolean r = vh.compareAndSet(null, $value1$, $value1$); 344 }); 345 checkCCE(() -> { // receiver reference class 346 boolean r = vh.compareAndSet(Void.class, $value1$, $value1$); 347 }); 348 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 349 boolean r = vh.compareAndSet(recv, Void.class, $value1$); 350 }); 351 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 352 boolean r = vh.compareAndSet(recv, $value1$, Void.class); 353 }); 354 checkWMTE(() -> { // receiver primitive class 355 boolean r = vh.compareAndSet(0, $value1$, $value1$); 356 }); 357 // Incorrect arity 358 checkWMTE(() -> { // 0 359 boolean r = vh.compareAndSet(); 360 }); 361 checkWMTE(() -> { // > 362 boolean r = vh.compareAndSet(recv, $value1$, $value1$, Void.class); 363 }); 364 365 366 // WeakCompareAndSet 367 // Incorrect argument types 368 checkNPE(() -> { // null receiver 369 boolean r = vh.weakCompareAndSetPlain(null, $value1$, $value1$); 370 }); 371 checkCCE(() -> { // receiver reference class 372 boolean r = vh.weakCompareAndSetPlain(Void.class, $value1$, $value1$); 373 }); 374 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 375 boolean r = vh.weakCompareAndSetPlain(recv, Void.class, $value1$); 376 }); 377 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 378 boolean r = vh.weakCompareAndSetPlain(recv, $value1$, Void.class); 379 }); 380 checkWMTE(() -> { // receiver primitive class 381 boolean r = vh.weakCompareAndSetPlain(0, $value1$, $value1$); 382 }); 383 // Incorrect arity 384 checkWMTE(() -> { // 0 385 boolean r = vh.weakCompareAndSetPlain(); 386 }); 387 checkWMTE(() -> { // > 388 boolean r = vh.weakCompareAndSetPlain(recv, $value1$, $value1$, Void.class); 389 }); 390 391 392 // WeakCompareAndSetVolatile 393 // Incorrect argument types 394 checkNPE(() -> { // null receiver 395 boolean r = vh.weakCompareAndSet(null, $value1$, $value1$); 396 }); 397 checkCCE(() -> { // receiver reference class 398 boolean r = vh.weakCompareAndSet(Void.class, $value1$, $value1$); 399 }); 400 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 401 boolean r = vh.weakCompareAndSet(recv, Void.class, $value1$); 402 }); 403 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 404 boolean r = vh.weakCompareAndSet(recv, $value1$, Void.class); 405 }); 406 checkWMTE(() -> { // receiver primitive class 407 boolean r = vh.weakCompareAndSet(0, $value1$, $value1$); 408 }); 409 // Incorrect arity 410 checkWMTE(() -> { // 0 411 boolean r = vh.weakCompareAndSet(); 412 }); 413 checkWMTE(() -> { // > 414 boolean r = vh.weakCompareAndSet(recv, $value1$, $value1$, Void.class); 415 }); 416 417 418 // WeakCompareAndSetAcquire 419 // Incorrect argument types 420 checkNPE(() -> { // null receiver 421 boolean r = vh.weakCompareAndSetAcquire(null, $value1$, $value1$); 422 }); 423 checkCCE(() -> { // receiver reference class 424 boolean r = vh.weakCompareAndSetAcquire(Void.class, $value1$, $value1$); 425 }); 426 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 427 boolean r = vh.weakCompareAndSetAcquire(recv, Void.class, $value1$); 428 }); 429 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 430 boolean r = vh.weakCompareAndSetAcquire(recv, $value1$, Void.class); 431 }); 432 checkWMTE(() -> { // receiver primitive class 433 boolean r = vh.weakCompareAndSetAcquire(0, $value1$, $value1$); 434 }); 435 // Incorrect arity 436 checkWMTE(() -> { // 0 437 boolean r = vh.weakCompareAndSetAcquire(); 438 }); 439 checkWMTE(() -> { // > 440 boolean r = vh.weakCompareAndSetAcquire(recv, $value1$, $value1$, Void.class); 441 }); 442 443 444 // WeakCompareAndSetRelease 445 // Incorrect argument types 446 checkNPE(() -> { // null receiver 447 boolean r = vh.weakCompareAndSetRelease(null, $value1$, $value1$); 448 }); 449 checkCCE(() -> { // receiver reference class 450 boolean r = vh.weakCompareAndSetRelease(Void.class, $value1$, $value1$); 451 }); 452 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 453 boolean r = vh.weakCompareAndSetRelease(recv, Void.class, $value1$); 454 }); 455 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 456 boolean r = vh.weakCompareAndSetRelease(recv, $value1$, Void.class); 457 }); 458 checkWMTE(() -> { // receiver primitive class 459 boolean r = vh.weakCompareAndSetRelease(0, $value1$, $value1$); 460 }); 461 // Incorrect arity 462 checkWMTE(() -> { // 0 463 boolean r = vh.weakCompareAndSetRelease(); 464 }); 465 checkWMTE(() -> { // > 466 boolean r = vh.weakCompareAndSetRelease(recv, $value1$, $value1$, Void.class); 467 }); 468 469 470 // CompareAndExchange 471 // Incorrect argument types 472 checkNPE(() -> { // null receiver 473 $type$ x = ($type$) vh.compareAndExchange(null, $value1$, $value1$); 474 }); 475 checkCCE(() -> { // receiver reference class 476 $type$ x = ($type$) vh.compareAndExchange(Void.class, $value1$, $value1$); 477 }); 478 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 479 $type$ x = ($type$) vh.compareAndExchange(recv, Void.class, $value1$); 480 }); 481 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 482 $type$ x = ($type$) vh.compareAndExchange(recv, $value1$, Void.class); 483 }); 484 checkWMTE(() -> { // reciever primitive class 485 $type$ x = ($type$) vh.compareAndExchange(0, $value1$, $value1$); 486 }); 487 // Incorrect return type 488 check{#if[Class]?CCE:WMTE}(() -> { // reference class 489 Void r = (Void) vh.compareAndExchange(recv, $value1$, $value1$); 490 }); 491 checkWMTE(() -> { // primitive class 492 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange(recv, $value1$, $value1$); 493 }); 494 // Incorrect arity 495 checkWMTE(() -> { // 0 496 $type$ x = ($type$) vh.compareAndExchange(); 497 }); 498 checkWMTE(() -> { // > 499 $type$ x = ($type$) vh.compareAndExchange(recv, $value1$, $value1$, Void.class); 500 }); 501 502 503 // CompareAndExchangeAcquire 504 // Incorrect argument types 505 checkNPE(() -> { // null receiver 506 $type$ x = ($type$) vh.compareAndExchangeAcquire(null, $value1$, $value1$); 507 }); 508 checkCCE(() -> { // receiver reference class 509 $type$ x = ($type$) vh.compareAndExchangeAcquire(Void.class, $value1$, $value1$); 510 }); 511 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 512 $type$ x = ($type$) vh.compareAndExchangeAcquire(recv, Void.class, $value1$); 513 }); 514 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 515 $type$ x = ($type$) vh.compareAndExchangeAcquire(recv, $value1$, Void.class); 516 }); 517 checkWMTE(() -> { // reciever primitive class 518 $type$ x = ($type$) vh.compareAndExchangeAcquire(0, $value1$, $value1$); 519 }); 520 // Incorrect return type 521 check{#if[Class]?CCE:WMTE}(() -> { // reference class 522 Void r = (Void) vh.compareAndExchangeAcquire(recv, $value1$, $value1$); 523 }); 524 checkWMTE(() -> { // primitive class 525 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeAcquire(recv, $value1$, $value1$); 526 }); 527 // Incorrect arity 528 checkWMTE(() -> { // 0 529 $type$ x = ($type$) vh.compareAndExchangeAcquire(); 530 }); 531 checkWMTE(() -> { // > 532 $type$ x = ($type$) vh.compareAndExchangeAcquire(recv, $value1$, $value1$, Void.class); 533 }); 534 535 536 // CompareAndExchangeRelease 537 // Incorrect argument types 538 checkNPE(() -> { // null receiver 539 $type$ x = ($type$) vh.compareAndExchangeRelease(null, $value1$, $value1$); 540 }); 541 checkCCE(() -> { // receiver reference class 542 $type$ x = ($type$) vh.compareAndExchangeRelease(Void.class, $value1$, $value1$); 543 }); 544 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 545 $type$ x = ($type$) vh.compareAndExchangeRelease(recv, Void.class, $value1$); 546 }); 547 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 548 $type$ x = ($type$) vh.compareAndExchangeRelease(recv, $value1$, Void.class); 549 }); 550 checkWMTE(() -> { // reciever primitive class 551 $type$ x = ($type$) vh.compareAndExchangeRelease(0, $value1$, $value1$); 552 }); 553 // Incorrect return type 554 check{#if[Class]?CCE:WMTE}(() -> { // reference class 555 Void r = (Void) vh.compareAndExchangeRelease(recv, $value1$, $value1$); 556 }); 557 checkWMTE(() -> { // primitive class 558 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeRelease(recv, $value1$, $value1$); 559 }); 560 // Incorrect arity 561 checkWMTE(() -> { // 0 562 $type$ x = ($type$) vh.compareAndExchangeRelease(); 563 }); 564 checkWMTE(() -> { // > 565 $type$ x = ($type$) vh.compareAndExchangeRelease(recv, $value1$, $value1$, Void.class); 566 }); 567 568 569 // GetAndSet 570 // Incorrect argument types 571 checkNPE(() -> { // null receiver 572 $type$ x = ($type$) vh.getAndSet(null, $value1$); 573 }); 574 checkCCE(() -> { // receiver reference class 575 $type$ x = ($type$) vh.getAndSet(Void.class, $value1$); 576 }); 577 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 578 $type$ x = ($type$) vh.getAndSet(recv, Void.class); 579 }); 580 checkWMTE(() -> { // reciever primitive class 581 $type$ x = ($type$) vh.getAndSet(0, $value1$); 582 }); 583 // Incorrect return type 584 check{#if[Class]?CCE:WMTE}(() -> { // reference class 585 Void r = (Void) vh.getAndSet(recv, $value1$); 586 }); 587 checkWMTE(() -> { // primitive class 588 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSet(recv, $value1$); 589 }); 590 // Incorrect arity 591 checkWMTE(() -> { // 0 592 $type$ x = ($type$) vh.getAndSet(); 593 }); 594 checkWMTE(() -> { // > 595 $type$ x = ($type$) vh.getAndSet(recv, $value1$, Void.class); 596 }); 597 598 // GetAndSetAcquire 599 // Incorrect argument types 600 checkNPE(() -> { // null receiver 601 $type$ x = ($type$) vh.getAndSetAcquire(null, $value1$); 602 }); 603 checkCCE(() -> { // receiver reference class 604 $type$ x = ($type$) vh.getAndSetAcquire(Void.class, $value1$); 605 }); 606 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 607 $type$ x = ($type$) vh.getAndSetAcquire(recv, Void.class); 608 }); 609 checkWMTE(() -> { // reciever primitive class 610 $type$ x = ($type$) vh.getAndSetAcquire(0, $value1$); 611 }); 612 // Incorrect return type 613 check{#if[Class]?CCE:WMTE}(() -> { // reference class 614 Void r = (Void) vh.getAndSetAcquire(recv, $value1$); 615 }); 616 checkWMTE(() -> { // primitive class 617 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetAcquire(recv, $value1$); 618 }); 619 // Incorrect arity 620 checkWMTE(() -> { // 0 621 $type$ x = ($type$) vh.getAndSetAcquire(); 622 }); 623 checkWMTE(() -> { // > 624 $type$ x = ($type$) vh.getAndSetAcquire(recv, $value1$, Void.class); 625 }); 626 627 // GetAndSetRelease 628 // Incorrect argument types 629 checkNPE(() -> { // null receiver 630 $type$ x = ($type$) vh.getAndSetRelease(null, $value1$); 631 }); 632 checkCCE(() -> { // receiver reference class 633 $type$ x = ($type$) vh.getAndSetRelease(Void.class, $value1$); 634 }); 635 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 636 $type$ x = ($type$) vh.getAndSetRelease(recv, Void.class); 637 }); 638 checkWMTE(() -> { // reciever primitive class 639 $type$ x = ($type$) vh.getAndSetRelease(0, $value1$); 640 }); 641 // Incorrect return type 642 check{#if[Class]?CCE:WMTE}(() -> { // reference class 643 Void r = (Void) vh.getAndSetRelease(recv, $value1$); 644 }); 645 checkWMTE(() -> { // primitive class 646 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetRelease(recv, $value1$); 647 }); 648 // Incorrect arity 649 checkWMTE(() -> { // 0 650 $type$ x = ($type$) vh.getAndSetRelease(); 651 }); 652 checkWMTE(() -> { // > 653 $type$ x = ($type$) vh.getAndSetRelease(recv, $value1$, Void.class); 654 }); 655 #end[CAS] 656 657 #if[AtomicAdd] 658 // GetAndAdd 659 // Incorrect argument types 660 checkNPE(() -> { // null receiver 661 $type$ x = ($type$) vh.getAndAdd(null, $value1$); 662 }); 663 checkCCE(() -> { // receiver reference class 664 $type$ x = ($type$) vh.getAndAdd(Void.class, $value1$); 665 }); 666 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 667 $type$ x = ($type$) vh.getAndAdd(recv, Void.class); 668 }); 669 checkWMTE(() -> { // reciever primitive class 670 $type$ x = ($type$) vh.getAndAdd(0, $value1$); 671 }); 672 // Incorrect return type 673 check{#if[Class]?CCE:WMTE}(() -> { // reference class 674 Void r = (Void) vh.getAndAdd(recv, $value1$); 675 }); 676 checkWMTE(() -> { // primitive class 677 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAdd(recv, $value1$); 678 }); 679 // Incorrect arity 680 checkWMTE(() -> { // 0 681 $type$ x = ($type$) vh.getAndAdd(); 682 }); 683 checkWMTE(() -> { // > 684 $type$ x = ($type$) vh.getAndAdd(recv, $value1$, Void.class); 685 }); 686 687 // GetAndAddAcquire 688 // Incorrect argument types 689 checkNPE(() -> { // null receiver 690 $type$ x = ($type$) vh.getAndAddAcquire(null, $value1$); 691 }); 692 checkCCE(() -> { // receiver reference class 693 $type$ x = ($type$) vh.getAndAddAcquire(Void.class, $value1$); 694 }); 695 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 696 $type$ x = ($type$) vh.getAndAddAcquire(recv, Void.class); 697 }); 698 checkWMTE(() -> { // reciever primitive class 699 $type$ x = ($type$) vh.getAndAddAcquire(0, $value1$); 700 }); 701 // Incorrect return type 702 check{#if[Class]?CCE:WMTE}(() -> { // reference class 703 Void r = (Void) vh.getAndAddAcquire(recv, $value1$); 704 }); 705 checkWMTE(() -> { // primitive class 706 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddAcquire(recv, $value1$); 707 }); 708 // Incorrect arity 709 checkWMTE(() -> { // 0 710 $type$ x = ($type$) vh.getAndAddAcquire(); 711 }); 712 checkWMTE(() -> { // > 713 $type$ x = ($type$) vh.getAndAddAcquire(recv, $value1$, Void.class); 714 }); 715 716 // GetAndAddRelease 717 // Incorrect argument types 718 checkNPE(() -> { // null receiver 719 $type$ x = ($type$) vh.getAndAddRelease(null, $value1$); 720 }); 721 checkCCE(() -> { // receiver reference class 722 $type$ x = ($type$) vh.getAndAddRelease(Void.class, $value1$); 723 }); 724 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 725 $type$ x = ($type$) vh.getAndAddRelease(recv, Void.class); 726 }); 727 checkWMTE(() -> { // reciever primitive class 728 $type$ x = ($type$) vh.getAndAddRelease(0, $value1$); 729 }); 730 // Incorrect return type 731 check{#if[Class]?CCE:WMTE}(() -> { // reference class 732 Void r = (Void) vh.getAndAddRelease(recv, $value1$); 733 }); 734 checkWMTE(() -> { // primitive class 735 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddRelease(recv, $value1$); 736 }); 737 // Incorrect arity 738 checkWMTE(() -> { // 0 739 $type$ x = ($type$) vh.getAndAddRelease(); 740 }); 741 checkWMTE(() -> { // > 742 $type$ x = ($type$) vh.getAndAddRelease(recv, $value1$, Void.class); 743 }); 744 #end[AtomicAdd] 745 746 #if[Bitwise] 747 // GetAndBitwiseOr 748 // Incorrect argument types 749 checkNPE(() -> { // null receiver 750 $type$ x = ($type$) vh.getAndBitwiseOr(null, $value1$); 751 }); 752 checkCCE(() -> { // receiver reference class 753 $type$ x = ($type$) vh.getAndBitwiseOr(Void.class, $value1$); 754 }); 755 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 756 $type$ x = ($type$) vh.getAndBitwiseOr(recv, Void.class); 757 }); 758 checkWMTE(() -> { // reciever primitive class 759 $type$ x = ($type$) vh.getAndBitwiseOr(0, $value1$); 760 }); 761 // Incorrect return type 762 check{#if[Class]?CCE:WMTE}(() -> { // reference class 763 Void r = (Void) vh.getAndBitwiseOr(recv, $value1$); 764 }); 765 checkWMTE(() -> { // primitive class 766 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOr(recv, $value1$); 767 }); 768 // Incorrect arity 769 checkWMTE(() -> { // 0 770 $type$ x = ($type$) vh.getAndBitwiseOr(); 771 }); 772 checkWMTE(() -> { // > 773 $type$ x = ($type$) vh.getAndBitwiseOr(recv, $value1$, Void.class); 774 }); 775 776 777 // GetAndBitwiseOrAcquire 778 // Incorrect argument types 779 checkNPE(() -> { // null receiver 780 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(null, $value1$); 781 }); 782 checkCCE(() -> { // receiver reference class 783 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(Void.class, $value1$); 784 }); 785 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 786 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(recv, Void.class); 787 }); 788 checkWMTE(() -> { // reciever primitive class 789 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(0, $value1$); 790 }); 791 // Incorrect return type 792 check{#if[Class]?CCE:WMTE}(() -> { // reference class 793 Void r = (Void) vh.getAndBitwiseOrAcquire(recv, $value1$); 794 }); 795 checkWMTE(() -> { // primitive class 796 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrAcquire(recv, $value1$); 797 }); 798 // Incorrect arity 799 checkWMTE(() -> { // 0 800 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(); 801 }); 802 checkWMTE(() -> { // > 803 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(recv, $value1$, Void.class); 804 }); 805 806 807 // GetAndBitwiseOrRelease 808 // Incorrect argument types 809 checkNPE(() -> { // null receiver 810 $type$ x = ($type$) vh.getAndBitwiseOrRelease(null, $value1$); 811 }); 812 checkCCE(() -> { // receiver reference class 813 $type$ x = ($type$) vh.getAndBitwiseOr(Void.class, $value1$); 814 }); 815 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 816 $type$ x = ($type$) vh.getAndBitwiseOr(recv, Void.class); 817 }); 818 checkWMTE(() -> { // reciever primitive class 819 $type$ x = ($type$) vh.getAndBitwiseOr(0, $value1$); 820 }); 821 // Incorrect return type 822 check{#if[Class]?CCE:WMTE}(() -> { // reference class 823 Void r = (Void) vh.getAndBitwiseOr(recv, $value1$); 824 }); 825 checkWMTE(() -> { // primitive class 826 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOr(recv, $value1$); 827 }); 828 // Incorrect arity 829 checkWMTE(() -> { // 0 830 $type$ x = ($type$) vh.getAndBitwiseOr(); 831 }); 832 checkWMTE(() -> { // > 833 $type$ x = ($type$) vh.getAndBitwiseOr(recv, $value1$, Void.class); 834 }); 835 836 837 // GetAndBitwiseAnd 838 // Incorrect argument types 839 checkNPE(() -> { // null receiver 840 $type$ x = ($type$) vh.getAndBitwiseAnd(null, $value1$); 841 }); 842 checkCCE(() -> { // receiver reference class 843 $type$ x = ($type$) vh.getAndBitwiseAnd(Void.class, $value1$); 844 }); 845 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 846 $type$ x = ($type$) vh.getAndBitwiseAnd(recv, Void.class); 847 }); 848 checkWMTE(() -> { // reciever primitive class 849 $type$ x = ($type$) vh.getAndBitwiseAnd(0, $value1$); 850 }); 851 // Incorrect return type 852 check{#if[Class]?CCE:WMTE}(() -> { // reference class 853 Void r = (Void) vh.getAndBitwiseAnd(recv, $value1$); 854 }); 855 checkWMTE(() -> { // primitive class 856 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAnd(recv, $value1$); 857 }); 858 // Incorrect arity 859 checkWMTE(() -> { // 0 860 $type$ x = ($type$) vh.getAndBitwiseAnd(); 861 }); 862 checkWMTE(() -> { // > 863 $type$ x = ($type$) vh.getAndBitwiseAnd(recv, $value1$, Void.class); 864 }); 865 866 867 // GetAndBitwiseAndAcquire 868 // Incorrect argument types 869 checkNPE(() -> { // null receiver 870 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(null, $value1$); 871 }); 872 checkCCE(() -> { // receiver reference class 873 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(Void.class, $value1$); 874 }); 875 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 876 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(recv, Void.class); 877 }); 878 checkWMTE(() -> { // reciever primitive class 879 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(0, $value1$); 880 }); 881 // Incorrect return type 882 check{#if[Class]?CCE:WMTE}(() -> { // reference class 883 Void r = (Void) vh.getAndBitwiseAndAcquire(recv, $value1$); 884 }); 885 checkWMTE(() -> { // primitive class 886 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndAcquire(recv, $value1$); 887 }); 888 // Incorrect arity 889 checkWMTE(() -> { // 0 890 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(); 891 }); 892 checkWMTE(() -> { // > 893 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(recv, $value1$, Void.class); 894 }); 895 896 897 // GetAndBitwiseAndRelease 898 // Incorrect argument types 899 checkNPE(() -> { // null receiver 900 $type$ x = ($type$) vh.getAndBitwiseAndRelease(null, $value1$); 901 }); 902 checkCCE(() -> { // receiver reference class 903 $type$ x = ($type$) vh.getAndBitwiseAnd(Void.class, $value1$); 904 }); 905 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 906 $type$ x = ($type$) vh.getAndBitwiseAnd(recv, Void.class); 907 }); 908 checkWMTE(() -> { // reciever primitive class 909 $type$ x = ($type$) vh.getAndBitwiseAnd(0, $value1$); 910 }); 911 // Incorrect return type 912 check{#if[Class]?CCE:WMTE}(() -> { // reference class 913 Void r = (Void) vh.getAndBitwiseAnd(recv, $value1$); 914 }); 915 checkWMTE(() -> { // primitive class 916 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAnd(recv, $value1$); 917 }); 918 // Incorrect arity 919 checkWMTE(() -> { // 0 920 $type$ x = ($type$) vh.getAndBitwiseAnd(); 921 }); 922 checkWMTE(() -> { // > 923 $type$ x = ($type$) vh.getAndBitwiseAnd(recv, $value1$, Void.class); 924 }); 925 926 927 // GetAndBitwiseXor 928 // Incorrect argument types 929 checkNPE(() -> { // null receiver 930 $type$ x = ($type$) vh.getAndBitwiseXor(null, $value1$); 931 }); 932 checkCCE(() -> { // receiver reference class 933 $type$ x = ($type$) vh.getAndBitwiseXor(Void.class, $value1$); 934 }); 935 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 936 $type$ x = ($type$) vh.getAndBitwiseXor(recv, Void.class); 937 }); 938 checkWMTE(() -> { // reciever primitive class 939 $type$ x = ($type$) vh.getAndBitwiseXor(0, $value1$); 940 }); 941 // Incorrect return type 942 check{#if[Class]?CCE:WMTE}(() -> { // reference class 943 Void r = (Void) vh.getAndBitwiseXor(recv, $value1$); 944 }); 945 checkWMTE(() -> { // primitive class 946 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXor(recv, $value1$); 947 }); 948 // Incorrect arity 949 checkWMTE(() -> { // 0 950 $type$ x = ($type$) vh.getAndBitwiseXor(); 951 }); 952 checkWMTE(() -> { // > 953 $type$ x = ($type$) vh.getAndBitwiseXor(recv, $value1$, Void.class); 954 }); 955 956 957 // GetAndBitwiseXorAcquire 958 // Incorrect argument types 959 checkNPE(() -> { // null receiver 960 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(null, $value1$); 961 }); 962 checkCCE(() -> { // receiver reference class 963 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(Void.class, $value1$); 964 }); 965 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 966 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(recv, Void.class); 967 }); 968 checkWMTE(() -> { // reciever primitive class 969 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(0, $value1$); 970 }); 971 // Incorrect return type 972 check{#if[Class]?CCE:WMTE}(() -> { // reference class 973 Void r = (Void) vh.getAndBitwiseXorAcquire(recv, $value1$); 974 }); 975 checkWMTE(() -> { // primitive class 976 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorAcquire(recv, $value1$); 977 }); 978 // Incorrect arity 979 checkWMTE(() -> { // 0 980 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(); 981 }); 982 checkWMTE(() -> { // > 983 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(recv, $value1$, Void.class); 984 }); 985 986 987 // GetAndBitwiseXorRelease 988 // Incorrect argument types 989 checkNPE(() -> { // null receiver 990 $type$ x = ($type$) vh.getAndBitwiseXorRelease(null, $value1$); 991 }); 992 checkCCE(() -> { // receiver reference class 993 $type$ x = ($type$) vh.getAndBitwiseXor(Void.class, $value1$); 994 }); 995 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 996 $type$ x = ($type$) vh.getAndBitwiseXor(recv, Void.class); 997 }); 998 checkWMTE(() -> { // reciever primitive class 999 $type$ x = ($type$) vh.getAndBitwiseXor(0, $value1$); 1000 }); 1001 // Incorrect return type 1002 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1003 Void r = (Void) vh.getAndBitwiseXor(recv, $value1$); 1004 }); 1005 checkWMTE(() -> { // primitive class 1006 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXor(recv, $value1$); 1007 }); 1008 // Incorrect arity 1009 checkWMTE(() -> { // 0 1010 $type$ x = ($type$) vh.getAndBitwiseXor(); 1011 }); 1012 checkWMTE(() -> { // > 1013 $type$ x = ($type$) vh.getAndBitwiseXor(recv, $value1$, Void.class); 1014 }); 1015 #end[Bitwise] 1016 } 1017 1018 static void testInstanceFieldWrongMethodType(VarHandleTestMethodType$Type$ recv, Handles hs) throws Throwable { 1019 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) { 1020 // Incorrect argument types 1021 checkNPE(() -> { // null receiver 1022 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class)). 1023 invokeExact((VarHandleTestMethodType$Type$) null); 1024 }); 1025 hs.checkWMTEOrCCE(() -> { // receiver reference class 1026 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class)). 1027 invokeExact(Void.class); 1028 }); 1029 checkWMTE(() -> { // receiver primitive class 1030 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class)). 1031 invokeExact(0); 1032 }); 1033 // Incorrect return type 1034 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 1035 Void x = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodType$Type$.class)). 1036 invokeExact(recv); 1037 }); 1038 checkWMTE(() -> { // primitive class 1039 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, VarHandleTestMethodType$Type$.class)). 1040 invokeExact(recv); 1041 }); 1042 // Incorrect arity 1043 checkWMTE(() -> { // 0 1044 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 1045 invokeExact(); 1046 }); 1047 checkWMTE(() -> { // > 1048 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, Class.class)). 1049 invokeExact(recv, Void.class); 1050 }); 1051 } 1052 1053 for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) { 1054 // Incorrect argument types 1055 checkNPE(() -> { // null receiver 1056 hs.get(am, methodType(void.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1057 invokeExact((VarHandleTestMethodType$Type$) null, $value1$); 1058 }); 1059 hs.checkWMTEOrCCE(() -> { // receiver reference class 1060 hs.get(am, methodType(void.class, Class.class, $type$.class)). 1061 invokeExact(Void.class, $value1$); 1062 }); 1063 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 1064 hs.get(am, methodType(void.class, VarHandleTestMethodType$Type$.class, Class.class)). 1065 invokeExact(recv, Void.class); 1066 }); 1067 checkWMTE(() -> { // receiver primitive class 1068 hs.get(am, methodType(void.class, int.class, $type$.class)). 1069 invokeExact(0, $value1$); 1070 }); 1071 // Incorrect arity 1072 checkWMTE(() -> { // 0 1073 hs.get(am, methodType(void.class)). 1074 invokeExact(); 1075 }); 1076 checkWMTE(() -> { // > 1077 hs.get(am, methodType(void.class, VarHandleTestMethodType$Type$.class, $type$.class, Class.class)). 1078 invokeExact(recv, $value1$, Void.class); 1079 }); 1080 } 1081 1082 #if[CAS] 1083 for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) { 1084 // Incorrect argument types 1085 checkNPE(() -> { // null receiver 1086 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodType$Type$.class, $type$.class, $type$.class)). 1087 invokeExact((VarHandleTestMethodType$Type$) null, $value1$, $value1$); 1088 }); 1089 hs.checkWMTEOrCCE(() -> { // receiver reference class 1090 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, $type$.class, $type$.class)). 1091 invokeExact(Void.class, $value1$, $value1$); 1092 }); 1093 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // expected reference class 1094 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodType$Type$.class, Class.class, $type$.class)). 1095 invokeExact(recv, Void.class, $value1$); 1096 }); 1097 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // actual reference class 1098 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodType$Type$.class, $type$.class, Class.class)). 1099 invokeExact(recv, $value1$, Void.class); 1100 }); 1101 checkWMTE(() -> { // receiver primitive class 1102 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class , $type$.class, $type$.class)). 1103 invokeExact(0, $value1$, $value1$); 1104 }); 1105 // Incorrect arity 1106 checkWMTE(() -> { // 0 1107 boolean r = (boolean) hs.get(am, methodType(boolean.class)). 1108 invokeExact(); 1109 }); 1110 checkWMTE(() -> { // > 1111 boolean r = (boolean) hs.get(am, methodType(boolean.class, VarHandleTestMethodType$Type$.class, $type$.class, $type$.class, Class.class)). 1112 invokeExact(recv, $value1$, $value1$, Void.class); 1113 }); 1114 } 1115 1116 for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) { 1117 checkNPE(() -> { // null receiver 1118 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class, $type$.class)). 1119 invokeExact((VarHandleTestMethodType$Type$) null, $value1$, $value1$); 1120 }); 1121 hs.checkWMTEOrCCE(() -> { // receiver reference class 1122 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, $type$.class, $type$.class)). 1123 invokeExact(Void.class, $value1$, $value1$); 1124 }); 1125 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // expected reference class 1126 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, Class.class, $type$.class)). 1127 invokeExact(recv, Void.class, $value1$); 1128 }); 1129 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // actual reference class 1130 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class, Class.class)). 1131 invokeExact(recv, $value1$, Void.class); 1132 }); 1133 checkWMTE(() -> { // reciever primitive class 1134 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class , $type$.class, $type$.class)). 1135 invokeExact(0, $value1$, $value1$); 1136 }); 1137 // Incorrect return type 1138 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 1139 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodType$Type$.class , $type$.class, $type$.class)). 1140 invokeExact(recv, $value1$, $value1$); 1141 }); 1142 checkWMTE(() -> { // primitive class 1143 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, VarHandleTestMethodType$Type$.class , $type$.class, $type$.class)). 1144 invokeExact(recv, $value1$, $value1$); 1145 }); 1146 // Incorrect arity 1147 checkWMTE(() -> { // 0 1148 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 1149 invokeExact(); 1150 }); 1151 checkWMTE(() -> { // > 1152 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class, $type$.class, Class.class)). 1153 invokeExact(recv, $value1$, $value1$, Void.class); 1154 }); 1155 } 1156 1157 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) { 1158 checkNPE(() -> { // null receiver 1159 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1160 invokeExact((VarHandleTestMethodType$Type$) null, $value1$); 1161 }); 1162 hs.checkWMTEOrCCE(() -> { // receiver reference class 1163 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, $type$.class)). 1164 invokeExact(Void.class, $value1$); 1165 }); 1166 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 1167 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, Class.class)). 1168 invokeExact(recv, Void.class); 1169 }); 1170 checkWMTE(() -> { // reciever primitive class 1171 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, $type$.class)). 1172 invokeExact(0, $value1$); 1173 }); 1174 // Incorrect return type 1175 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 1176 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1177 invokeExact(recv, $value1$); 1178 }); 1179 checkWMTE(() -> { // primitive class 1180 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1181 invokeExact(recv, $value1$); 1182 }); 1183 // Incorrect arity 1184 checkWMTE(() -> { // 0 1185 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 1186 invokeExact(); 1187 }); 1188 checkWMTE(() -> { // > 1189 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1190 invokeExact(recv, $value1$, Void.class); 1191 }); 1192 } 1193 #end[CAS] 1194 1195 #if[AtomicAdd] 1196 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) { 1197 checkNPE(() -> { // null receiver 1198 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1199 invokeExact((VarHandleTestMethodType$Type$) null, $value1$); 1200 }); 1201 hs.checkWMTEOrCCE(() -> { // receiver reference class 1202 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, $type$.class)). 1203 invokeExact(Void.class, $value1$); 1204 }); 1205 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 1206 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, Class.class)). 1207 invokeExact(recv, Void.class); 1208 }); 1209 checkWMTE(() -> { // reciever primitive class 1210 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, $type$.class)). 1211 invokeExact(0, $value1$); 1212 }); 1213 // Incorrect return type 1214 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 1215 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1216 invokeExact(recv, $value1$); 1217 }); 1218 checkWMTE(() -> { // primitive class 1219 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1220 invokeExact(recv, $value1$); 1221 }); 1222 // Incorrect arity 1223 checkWMTE(() -> { // 0 1224 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 1225 invokeExact(); 1226 }); 1227 checkWMTE(() -> { // > 1228 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1229 invokeExact(recv, $value1$, Void.class); 1230 }); 1231 } 1232 #end[AtomicAdd] 1233 1234 #if[Bitwise] 1235 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) { 1236 checkNPE(() -> { // null receiver 1237 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1238 invokeExact((VarHandleTestMethodType$Type$) null, $value1$); 1239 }); 1240 hs.checkWMTEOrCCE(() -> { // receiver reference class 1241 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, $type$.class)). 1242 invokeExact(Void.class, $value1$); 1243 }); 1244 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 1245 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, Class.class)). 1246 invokeExact(recv, Void.class); 1247 }); 1248 checkWMTE(() -> { // reciever primitive class 1249 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, $type$.class)). 1250 invokeExact(0, $value1$); 1251 }); 1252 // Incorrect return type 1253 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 1254 Void r = (Void) hs.get(am, methodType(Void.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1255 invokeExact(recv, $value1$); 1256 }); 1257 checkWMTE(() -> { // primitive class 1258 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1259 invokeExact(recv, $value1$); 1260 }); 1261 // Incorrect arity 1262 checkWMTE(() -> { // 0 1263 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 1264 invokeExact(); 1265 }); 1266 checkWMTE(() -> { // > 1267 $type$ x = ($type$) hs.get(am, methodType($type$.class, VarHandleTestMethodType$Type$.class, $type$.class)). 1268 invokeExact(recv, $value1$, Void.class); 1269 }); 1270 } 1271 #end[Bitwise] 1272 } 1273 1274 1275 static void testStaticFieldWrongMethodType(VarHandle vh) throws Throwable { 1276 // Get 1277 // Incorrect return type 1278 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1279 Void x = (Void) vh.get(); 1280 }); 1281 checkWMTE(() -> { // primitive class 1282 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.get(); 1283 }); 1284 // Incorrect arity 1285 checkWMTE(() -> { // > 1286 $type$ x = ($type$) vh.get(Void.class); 1287 }); 1288 1289 1290 // Set 1291 // Incorrect argument types 1292 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1293 vh.set(Void.class); 1294 }); 1295 // Incorrect arity 1296 checkWMTE(() -> { // 0 1297 vh.set(); 1298 }); 1299 checkWMTE(() -> { // > 1300 vh.set($value1$, Void.class); 1301 }); 1302 1303 1304 // GetVolatile 1305 // Incorrect return type 1306 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1307 Void x = (Void) vh.getVolatile(); 1308 }); 1309 checkWMTE(() -> { // primitive class 1310 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getVolatile(); 1311 }); 1312 checkWMTE(() -> { // > 1313 $type$ x = ($type$) vh.getVolatile(Void.class); 1314 }); 1315 1316 1317 // SetVolatile 1318 // Incorrect argument types 1319 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1320 vh.setVolatile(Void.class); 1321 }); 1322 // Incorrect arity 1323 checkWMTE(() -> { // 0 1324 vh.setVolatile(); 1325 }); 1326 checkWMTE(() -> { // > 1327 vh.setVolatile($value1$, Void.class); 1328 }); 1329 1330 1331 // GetOpaque 1332 // Incorrect return type 1333 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1334 Void x = (Void) vh.getOpaque(); 1335 }); 1336 checkWMTE(() -> { // primitive class 1337 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getOpaque(); 1338 }); 1339 checkWMTE(() -> { // > 1340 $type$ x = ($type$) vh.getOpaque(Void.class); 1341 }); 1342 1343 1344 // SetOpaque 1345 // Incorrect argument types 1346 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1347 vh.setOpaque(Void.class); 1348 }); 1349 // Incorrect arity 1350 checkWMTE(() -> { // 0 1351 vh.setOpaque(); 1352 }); 1353 checkWMTE(() -> { // > 1354 vh.setOpaque($value1$, Void.class); 1355 }); 1356 1357 1358 // GetAcquire 1359 // Incorrect return type 1360 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1361 Void x = (Void) vh.getAcquire(); 1362 }); 1363 checkWMTE(() -> { // primitive class 1364 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAcquire(); 1365 }); 1366 checkWMTE(() -> { // > 1367 $type$ x = ($type$) vh.getAcquire(Void.class); 1368 }); 1369 1370 1371 // SetRelease 1372 // Incorrect argument types 1373 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1374 vh.setRelease(Void.class); 1375 }); 1376 // Incorrect arity 1377 checkWMTE(() -> { // 0 1378 vh.setRelease(); 1379 }); 1380 checkWMTE(() -> { // > 1381 vh.setRelease($value1$, Void.class); 1382 }); 1383 1384 1385 #if[CAS] 1386 // CompareAndSet 1387 // Incorrect argument types 1388 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 1389 boolean r = vh.compareAndSet(Void.class, $value1$); 1390 }); 1391 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 1392 boolean r = vh.compareAndSet($value1$, Void.class); 1393 }); 1394 // Incorrect arity 1395 checkWMTE(() -> { // 0 1396 boolean r = vh.compareAndSet(); 1397 }); 1398 checkWMTE(() -> { // > 1399 boolean r = vh.compareAndSet($value1$, $value1$, Void.class); 1400 }); 1401 1402 1403 // WeakCompareAndSet 1404 // Incorrect argument types 1405 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 1406 boolean r = vh.weakCompareAndSetPlain(Void.class, $value1$); 1407 }); 1408 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 1409 boolean r = vh.weakCompareAndSetPlain($value1$, Void.class); 1410 }); 1411 // Incorrect arity 1412 checkWMTE(() -> { // 0 1413 boolean r = vh.weakCompareAndSetPlain(); 1414 }); 1415 checkWMTE(() -> { // > 1416 boolean r = vh.weakCompareAndSetPlain($value1$, $value1$, Void.class); 1417 }); 1418 1419 1420 // WeakCompareAndSetVolatile 1421 // Incorrect argument types 1422 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 1423 boolean r = vh.weakCompareAndSet(Void.class, $value1$); 1424 }); 1425 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 1426 boolean r = vh.weakCompareAndSet($value1$, Void.class); 1427 }); 1428 // Incorrect arity 1429 checkWMTE(() -> { // 0 1430 boolean r = vh.weakCompareAndSet(); 1431 }); 1432 checkWMTE(() -> { // > 1433 boolean r = vh.weakCompareAndSet($value1$, $value1$, Void.class); 1434 }); 1435 1436 1437 // WeakCompareAndSetAcquire 1438 // Incorrect argument types 1439 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 1440 boolean r = vh.weakCompareAndSetAcquire(Void.class, $value1$); 1441 }); 1442 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 1443 boolean r = vh.weakCompareAndSetAcquire($value1$, Void.class); 1444 }); 1445 // Incorrect arity 1446 checkWMTE(() -> { // 0 1447 boolean r = vh.weakCompareAndSetAcquire(); 1448 }); 1449 checkWMTE(() -> { // > 1450 boolean r = vh.weakCompareAndSetAcquire($value1$, $value1$, Void.class); 1451 }); 1452 1453 1454 // WeakCompareAndSetRelease 1455 // Incorrect argument types 1456 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 1457 boolean r = vh.weakCompareAndSetRelease(Void.class, $value1$); 1458 }); 1459 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 1460 boolean r = vh.weakCompareAndSetRelease($value1$, Void.class); 1461 }); 1462 // Incorrect arity 1463 checkWMTE(() -> { // 0 1464 boolean r = vh.weakCompareAndSetRelease(); 1465 }); 1466 checkWMTE(() -> { // > 1467 boolean r = vh.weakCompareAndSetRelease($value1$, $value1$, Void.class); 1468 }); 1469 1470 1471 // CompareAndExchange 1472 // Incorrect argument types 1473 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 1474 $type$ x = ($type$) vh.compareAndExchange(Void.class, $value1$); 1475 }); 1476 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 1477 $type$ x = ($type$) vh.compareAndExchange($value1$, Void.class); 1478 }); 1479 // Incorrect return type 1480 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1481 Void r = (Void) vh.compareAndExchange($value1$, $value1$); 1482 }); 1483 checkWMTE(() -> { // primitive class 1484 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange($value1$, $value1$); 1485 }); 1486 // Incorrect arity 1487 checkWMTE(() -> { // 0 1488 $type$ x = ($type$) vh.compareAndExchange(); 1489 }); 1490 checkWMTE(() -> { // > 1491 $type$ x = ($type$) vh.compareAndExchange($value1$, $value1$, Void.class); 1492 }); 1493 1494 1495 // CompareAndExchangeAcquire 1496 // Incorrect argument types 1497 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 1498 $type$ x = ($type$) vh.compareAndExchangeAcquire(Void.class, $value1$); 1499 }); 1500 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 1501 $type$ x = ($type$) vh.compareAndExchangeAcquire($value1$, Void.class); 1502 }); 1503 // Incorrect return type 1504 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1505 Void r = (Void) vh.compareAndExchangeAcquire($value1$, $value1$); 1506 }); 1507 checkWMTE(() -> { // primitive class 1508 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeAcquire($value1$, $value1$); 1509 }); 1510 // Incorrect arity 1511 checkWMTE(() -> { // 0 1512 $type$ x = ($type$) vh.compareAndExchangeAcquire(); 1513 }); 1514 checkWMTE(() -> { // > 1515 $type$ x = ($type$) vh.compareAndExchangeAcquire($value1$, $value1$, Void.class); 1516 }); 1517 1518 1519 // CompareAndExchangeRelease 1520 // Incorrect argument types 1521 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 1522 $type$ x = ($type$) vh.compareAndExchangeRelease(Void.class, $value1$); 1523 }); 1524 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 1525 $type$ x = ($type$) vh.compareAndExchangeRelease($value1$, Void.class); 1526 }); 1527 // Incorrect return type 1528 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1529 Void r = (Void) vh.compareAndExchangeRelease($value1$, $value1$); 1530 }); 1531 checkWMTE(() -> { // primitive class 1532 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeRelease($value1$, $value1$); 1533 }); 1534 // Incorrect arity 1535 checkWMTE(() -> { // 0 1536 $type$ x = ($type$) vh.compareAndExchangeRelease(); 1537 }); 1538 checkWMTE(() -> { // > 1539 $type$ x = ($type$) vh.compareAndExchangeRelease($value1$, $value1$, Void.class); 1540 }); 1541 1542 1543 // GetAndSet 1544 // Incorrect argument types 1545 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1546 $type$ x = ($type$) vh.getAndSet(Void.class); 1547 }); 1548 // Incorrect return type 1549 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1550 Void r = (Void) vh.getAndSet($value1$); 1551 }); 1552 checkWMTE(() -> { // primitive class 1553 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSet($value1$); 1554 }); 1555 // Incorrect arity 1556 checkWMTE(() -> { // 0 1557 $type$ x = ($type$) vh.getAndSet(); 1558 }); 1559 checkWMTE(() -> { // > 1560 $type$ x = ($type$) vh.getAndSet($value1$, Void.class); 1561 }); 1562 1563 1564 // GetAndSetAcquire 1565 // Incorrect argument types 1566 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1567 $type$ x = ($type$) vh.getAndSetAcquire(Void.class); 1568 }); 1569 // Incorrect return type 1570 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1571 Void r = (Void) vh.getAndSetAcquire($value1$); 1572 }); 1573 checkWMTE(() -> { // primitive class 1574 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetAcquire($value1$); 1575 }); 1576 // Incorrect arity 1577 checkWMTE(() -> { // 0 1578 $type$ x = ($type$) vh.getAndSetAcquire(); 1579 }); 1580 checkWMTE(() -> { // > 1581 $type$ x = ($type$) vh.getAndSetAcquire($value1$, Void.class); 1582 }); 1583 1584 1585 // GetAndSetRelease 1586 // Incorrect argument types 1587 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1588 $type$ x = ($type$) vh.getAndSetRelease(Void.class); 1589 }); 1590 // Incorrect return type 1591 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1592 Void r = (Void) vh.getAndSetRelease($value1$); 1593 }); 1594 checkWMTE(() -> { // primitive class 1595 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetRelease($value1$); 1596 }); 1597 // Incorrect arity 1598 checkWMTE(() -> { // 0 1599 $type$ x = ($type$) vh.getAndSetRelease(); 1600 }); 1601 checkWMTE(() -> { // > 1602 $type$ x = ($type$) vh.getAndSetRelease($value1$, Void.class); 1603 }); 1604 #end[CAS] 1605 1606 #if[AtomicAdd] 1607 // GetAndAdd 1608 // Incorrect argument types 1609 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1610 $type$ x = ($type$) vh.getAndAdd(Void.class); 1611 }); 1612 // Incorrect return type 1613 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1614 Void r = (Void) vh.getAndAdd($value1$); 1615 }); 1616 checkWMTE(() -> { // primitive class 1617 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAdd($value1$); 1618 }); 1619 // Incorrect arity 1620 checkWMTE(() -> { // 0 1621 $type$ x = ($type$) vh.getAndAdd(); 1622 }); 1623 checkWMTE(() -> { // > 1624 $type$ x = ($type$) vh.getAndAdd($value1$, Void.class); 1625 }); 1626 1627 1628 // GetAndAddAcquire 1629 // Incorrect argument types 1630 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1631 $type$ x = ($type$) vh.getAndAddAcquire(Void.class); 1632 }); 1633 // Incorrect return type 1634 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1635 Void r = (Void) vh.getAndAddAcquire($value1$); 1636 }); 1637 checkWMTE(() -> { // primitive class 1638 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddAcquire($value1$); 1639 }); 1640 // Incorrect arity 1641 checkWMTE(() -> { // 0 1642 $type$ x = ($type$) vh.getAndAddAcquire(); 1643 }); 1644 checkWMTE(() -> { // > 1645 $type$ x = ($type$) vh.getAndAddAcquire($value1$, Void.class); 1646 }); 1647 1648 1649 // GetAndAddRelease 1650 // Incorrect argument types 1651 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1652 $type$ x = ($type$) vh.getAndAddRelease(Void.class); 1653 }); 1654 // Incorrect return type 1655 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1656 Void r = (Void) vh.getAndAddRelease($value1$); 1657 }); 1658 checkWMTE(() -> { // primitive class 1659 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddRelease($value1$); 1660 }); 1661 // Incorrect arity 1662 checkWMTE(() -> { // 0 1663 $type$ x = ($type$) vh.getAndAddRelease(); 1664 }); 1665 checkWMTE(() -> { // > 1666 $type$ x = ($type$) vh.getAndAddRelease($value1$, Void.class); 1667 }); 1668 #end[AtomicAdd] 1669 1670 #if[Bitwise] 1671 // GetAndBitwiseOr 1672 // Incorrect argument types 1673 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1674 $type$ x = ($type$) vh.getAndBitwiseOr(Void.class); 1675 }); 1676 // Incorrect return type 1677 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1678 Void r = (Void) vh.getAndBitwiseOr($value1$); 1679 }); 1680 checkWMTE(() -> { // primitive class 1681 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOr($value1$); 1682 }); 1683 // Incorrect arity 1684 checkWMTE(() -> { // 0 1685 $type$ x = ($type$) vh.getAndBitwiseOr(); 1686 }); 1687 checkWMTE(() -> { // > 1688 $type$ x = ($type$) vh.getAndBitwiseOr($value1$, Void.class); 1689 }); 1690 1691 1692 // GetAndBitwiseOrAcquire 1693 // Incorrect argument types 1694 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1695 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(Void.class); 1696 }); 1697 // Incorrect return type 1698 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1699 Void r = (Void) vh.getAndBitwiseOrAcquire($value1$); 1700 }); 1701 checkWMTE(() -> { // primitive class 1702 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrAcquire($value1$); 1703 }); 1704 // Incorrect arity 1705 checkWMTE(() -> { // 0 1706 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(); 1707 }); 1708 checkWMTE(() -> { // > 1709 $type$ x = ($type$) vh.getAndBitwiseOrAcquire($value1$, Void.class); 1710 }); 1711 1712 1713 // GetAndBitwiseOrReleaseRelease 1714 // Incorrect argument types 1715 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1716 $type$ x = ($type$) vh.getAndBitwiseOrRelease(Void.class); 1717 }); 1718 // Incorrect return type 1719 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1720 Void r = (Void) vh.getAndBitwiseOrRelease($value1$); 1721 }); 1722 checkWMTE(() -> { // primitive class 1723 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrRelease($value1$); 1724 }); 1725 // Incorrect arity 1726 checkWMTE(() -> { // 0 1727 $type$ x = ($type$) vh.getAndBitwiseOrRelease(); 1728 }); 1729 checkWMTE(() -> { // > 1730 $type$ x = ($type$) vh.getAndBitwiseOrRelease($value1$, Void.class); 1731 }); 1732 1733 1734 // GetAndBitwiseAnd 1735 // Incorrect argument types 1736 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1737 $type$ x = ($type$) vh.getAndBitwiseAnd(Void.class); 1738 }); 1739 // Incorrect return type 1740 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1741 Void r = (Void) vh.getAndBitwiseAnd($value1$); 1742 }); 1743 checkWMTE(() -> { // primitive class 1744 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAnd($value1$); 1745 }); 1746 // Incorrect arity 1747 checkWMTE(() -> { // 0 1748 $type$ x = ($type$) vh.getAndBitwiseAnd(); 1749 }); 1750 checkWMTE(() -> { // > 1751 $type$ x = ($type$) vh.getAndBitwiseAnd($value1$, Void.class); 1752 }); 1753 1754 1755 // GetAndBitwiseAndAcquire 1756 // Incorrect argument types 1757 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1758 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(Void.class); 1759 }); 1760 // Incorrect return type 1761 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1762 Void r = (Void) vh.getAndBitwiseAndAcquire($value1$); 1763 }); 1764 checkWMTE(() -> { // primitive class 1765 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndAcquire($value1$); 1766 }); 1767 // Incorrect arity 1768 checkWMTE(() -> { // 0 1769 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(); 1770 }); 1771 checkWMTE(() -> { // > 1772 $type$ x = ($type$) vh.getAndBitwiseAndAcquire($value1$, Void.class); 1773 }); 1774 1775 1776 // GetAndBitwiseAndReleaseRelease 1777 // Incorrect argument types 1778 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1779 $type$ x = ($type$) vh.getAndBitwiseAndRelease(Void.class); 1780 }); 1781 // Incorrect return type 1782 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1783 Void r = (Void) vh.getAndBitwiseAndRelease($value1$); 1784 }); 1785 checkWMTE(() -> { // primitive class 1786 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndRelease($value1$); 1787 }); 1788 // Incorrect arity 1789 checkWMTE(() -> { // 0 1790 $type$ x = ($type$) vh.getAndBitwiseAndRelease(); 1791 }); 1792 checkWMTE(() -> { // > 1793 $type$ x = ($type$) vh.getAndBitwiseAndRelease($value1$, Void.class); 1794 }); 1795 1796 1797 // GetAndBitwiseXor 1798 // Incorrect argument types 1799 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1800 $type$ x = ($type$) vh.getAndBitwiseXor(Void.class); 1801 }); 1802 // Incorrect return type 1803 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1804 Void r = (Void) vh.getAndBitwiseXor($value1$); 1805 }); 1806 checkWMTE(() -> { // primitive class 1807 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXor($value1$); 1808 }); 1809 // Incorrect arity 1810 checkWMTE(() -> { // 0 1811 $type$ x = ($type$) vh.getAndBitwiseXor(); 1812 }); 1813 checkWMTE(() -> { // > 1814 $type$ x = ($type$) vh.getAndBitwiseXor($value1$, Void.class); 1815 }); 1816 1817 1818 // GetAndBitwiseXorAcquire 1819 // Incorrect argument types 1820 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1821 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(Void.class); 1822 }); 1823 // Incorrect return type 1824 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1825 Void r = (Void) vh.getAndBitwiseXorAcquire($value1$); 1826 }); 1827 checkWMTE(() -> { // primitive class 1828 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorAcquire($value1$); 1829 }); 1830 // Incorrect arity 1831 checkWMTE(() -> { // 0 1832 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(); 1833 }); 1834 checkWMTE(() -> { // > 1835 $type$ x = ($type$) vh.getAndBitwiseXorAcquire($value1$, Void.class); 1836 }); 1837 1838 1839 // GetAndBitwiseXorReleaseRelease 1840 // Incorrect argument types 1841 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1842 $type$ x = ($type$) vh.getAndBitwiseXorRelease(Void.class); 1843 }); 1844 // Incorrect return type 1845 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1846 Void r = (Void) vh.getAndBitwiseXorRelease($value1$); 1847 }); 1848 checkWMTE(() -> { // primitive class 1849 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorRelease($value1$); 1850 }); 1851 // Incorrect arity 1852 checkWMTE(() -> { // 0 1853 $type$ x = ($type$) vh.getAndBitwiseXorRelease(); 1854 }); 1855 checkWMTE(() -> { // > 1856 $type$ x = ($type$) vh.getAndBitwiseXorRelease($value1$, Void.class); 1857 }); 1858 #end[Bitwise] 1859 } 1860 1861 static void testStaticFieldWrongMethodType(Handles hs) throws Throwable { 1862 int i = 0; 1863 1864 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) { 1865 // Incorrect return type 1866 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 1867 Void x = (Void) hs.get(am, methodType(Void.class)). 1868 invokeExact(); 1869 }); 1870 checkWMTE(() -> { // primitive class 1871 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class)). 1872 invokeExact(); 1873 }); 1874 // Incorrect arity 1875 checkWMTE(() -> { // > 1876 $type$ x = ($type$) hs.get(am, methodType(Class.class)). 1877 invokeExact(Void.class); 1878 }); 1879 } 1880 1881 for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) { 1882 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 1883 hs.get(am, methodType(void.class, Class.class)). 1884 invokeExact(Void.class); 1885 }); 1886 // Incorrect arity 1887 checkWMTE(() -> { // 0 1888 hs.get(am, methodType(void.class)). 1889 invokeExact(); 1890 }); 1891 checkWMTE(() -> { // > 1892 hs.get(am, methodType(void.class, $type$.class, Class.class)). 1893 invokeExact($value1$, Void.class); 1894 }); 1895 } 1896 #if[CAS] 1897 for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) { 1898 // Incorrect argument types 1899 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // expected reference class 1900 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, $type$.class)). 1901 invokeExact(Void.class, $value1$); 1902 }); 1903 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // actual reference class 1904 boolean r = (boolean) hs.get(am, methodType(boolean.class, $type$.class, Class.class)). 1905 invokeExact($value1$, Void.class); 1906 }); 1907 // Incorrect arity 1908 checkWMTE(() -> { // 0 1909 boolean r = (boolean) hs.get(am, methodType(boolean.class)). 1910 invokeExact(); 1911 }); 1912 checkWMTE(() -> { // > 1913 boolean r = (boolean) hs.get(am, methodType(boolean.class, $type$.class, $type$.class, Class.class)). 1914 invokeExact($value1$, $value1$, Void.class); 1915 }); 1916 } 1917 1918 for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) { 1919 // Incorrect argument types 1920 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // expected reference class 1921 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, $type$.class)). 1922 invokeExact(Void.class, $value1$); 1923 }); 1924 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // actual reference class 1925 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$.class, Class.class)). 1926 invokeExact($value1$, Void.class); 1927 }); 1928 // Incorrect return type 1929 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 1930 Void r = (Void) hs.get(am, methodType(Void.class, $type$.class, $type$.class)). 1931 invokeExact($value1$, $value1$); 1932 }); 1933 checkWMTE(() -> { // primitive class 1934 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$.class, $type$.class)). 1935 invokeExact($value1$, $value1$); 1936 }); 1937 // Incorrect arity 1938 checkWMTE(() -> { // 0 1939 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 1940 invokeExact(); 1941 }); 1942 checkWMTE(() -> { // > 1943 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$.class, $type$.class, Class.class)). 1944 invokeExact($value1$, $value1$, Void.class); 1945 }); 1946 } 1947 1948 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) { 1949 // Incorrect argument types 1950 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 1951 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class)). 1952 invokeExact(Void.class); 1953 }); 1954 // Incorrect return type 1955 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 1956 Void r = (Void) hs.get(am, methodType(Void.class, $type$.class)). 1957 invokeExact($value1$); 1958 }); 1959 checkWMTE(() -> { // primitive class 1960 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$.class)). 1961 invokeExact($value1$); 1962 }); 1963 // Incorrect arity 1964 checkWMTE(() -> { // 0 1965 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 1966 invokeExact(); 1967 }); 1968 checkWMTE(() -> { // > 1969 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$.class, Class.class)). 1970 invokeExact($value1$, Void.class); 1971 }); 1972 } 1973 #end[CAS] 1974 1975 #if[AtomicAdd] 1976 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) { 1977 // Incorrect argument types 1978 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 1979 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class)). 1980 invokeExact(Void.class); 1981 }); 1982 // Incorrect return type 1983 check{#if[Class]?CCE:WMTE}(() -> { // reference class 1984 Void r = (Void) hs.get(am, methodType(Void.class, $type$.class)). 1985 invokeExact($value1$); 1986 }); 1987 checkWMTE(() -> { // primitive class 1988 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$.class)). 1989 invokeExact($value1$); 1990 }); 1991 // Incorrect arity 1992 checkWMTE(() -> { // 0 1993 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 1994 invokeExact(); 1995 }); 1996 checkWMTE(() -> { // > 1997 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$.class, Class.class)). 1998 invokeExact($value1$, Void.class); 1999 }); 2000 } 2001 #end[AtomicAdd] 2002 2003 #if[Bitwise] 2004 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) { 2005 // Incorrect argument types 2006 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2007 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class)). 2008 invokeExact(Void.class); 2009 }); 2010 // Incorrect return type 2011 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2012 Void r = (Void) hs.get(am, methodType(Void.class, $type$.class)). 2013 invokeExact($value1$); 2014 }); 2015 checkWMTE(() -> { // primitive class 2016 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$.class)). 2017 invokeExact($value1$); 2018 }); 2019 // Incorrect arity 2020 checkWMTE(() -> { // 0 2021 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 2022 invokeExact(); 2023 }); 2024 checkWMTE(() -> { // > 2025 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$.class, Class.class)). 2026 invokeExact($value1$, Void.class); 2027 }); 2028 } 2029 #end[Bitwise] 2030 } 2031 2032 2033 static void testArrayWrongMethodType(VarHandle vh) throws Throwable { 2034 $type$[] array = new $type$[10]; 2035 Arrays.fill(array, $value1$); 2036 2037 // Get 2038 // Incorrect argument types 2039 checkNPE(() -> { // null array 2040 $type$ x = ($type$) vh.get(null, 0); 2041 }); 2042 checkCCE(() -> { // array reference class 2043 $type$ x = ($type$) vh.get(Void.class, 0); 2044 }); 2045 checkWMTE(() -> { // array primitive class 2046 $type$ x = ($type$) vh.get(0, 0); 2047 }); 2048 checkWMTE(() -> { // index reference class 2049 $type$ x = ($type$) vh.get(array, Void.class); 2050 }); 2051 // Incorrect return type 2052 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2053 Void x = (Void) vh.get(array, 0); 2054 }); 2055 checkWMTE(() -> { // primitive class 2056 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.get(array, 0); 2057 }); 2058 // Incorrect arity 2059 checkWMTE(() -> { // 0 2060 $type$ x = ($type$) vh.get(); 2061 }); 2062 checkWMTE(() -> { // > 2063 $type$ x = ($type$) vh.get(array, 0, Void.class); 2064 }); 2065 2066 2067 // Set 2068 // Incorrect argument types 2069 checkNPE(() -> { // null array 2070 vh.set(null, 0, $value1$); 2071 }); 2072 checkCCE(() -> { // array reference class 2073 vh.set(Void.class, 0, $value1$); 2074 }); 2075 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2076 vh.set(array, 0, Void.class); 2077 }); 2078 checkWMTE(() -> { // receiver primitive class 2079 vh.set(0, 0, $value1$); 2080 }); 2081 checkWMTE(() -> { // index reference class 2082 vh.set(array, Void.class, $value1$); 2083 }); 2084 // Incorrect arity 2085 checkWMTE(() -> { // 0 2086 vh.set(); 2087 }); 2088 checkWMTE(() -> { // > 2089 vh.set(array, 0, $value1$, Void.class); 2090 }); 2091 2092 2093 // GetVolatile 2094 // Incorrect argument types 2095 checkNPE(() -> { // null array 2096 $type$ x = ($type$) vh.getVolatile(null, 0); 2097 }); 2098 checkCCE(() -> { // array reference class 2099 $type$ x = ($type$) vh.getVolatile(Void.class, 0); 2100 }); 2101 checkWMTE(() -> { // array primitive class 2102 $type$ x = ($type$) vh.getVolatile(0, 0); 2103 }); 2104 checkWMTE(() -> { // index reference class 2105 $type$ x = ($type$) vh.getVolatile(array, Void.class); 2106 }); 2107 // Incorrect return type 2108 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2109 Void x = (Void) vh.getVolatile(array, 0); 2110 }); 2111 checkWMTE(() -> { // primitive class 2112 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getVolatile(array, 0); 2113 }); 2114 // Incorrect arity 2115 checkWMTE(() -> { // 0 2116 $type$ x = ($type$) vh.getVolatile(); 2117 }); 2118 checkWMTE(() -> { // > 2119 $type$ x = ($type$) vh.getVolatile(array, 0, Void.class); 2120 }); 2121 2122 2123 // SetVolatile 2124 // Incorrect argument types 2125 checkNPE(() -> { // null array 2126 vh.setVolatile(null, 0, $value1$); 2127 }); 2128 checkCCE(() -> { // array reference class 2129 vh.setVolatile(Void.class, 0, $value1$); 2130 }); 2131 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2132 vh.setVolatile(array, 0, Void.class); 2133 }); 2134 checkWMTE(() -> { // receiver primitive class 2135 vh.setVolatile(0, 0, $value1$); 2136 }); 2137 checkWMTE(() -> { // index reference class 2138 vh.setVolatile(array, Void.class, $value1$); 2139 }); 2140 // Incorrect arity 2141 checkWMTE(() -> { // 0 2142 vh.setVolatile(); 2143 }); 2144 checkWMTE(() -> { // > 2145 vh.setVolatile(array, 0, $value1$, Void.class); 2146 }); 2147 2148 2149 // GetOpaque 2150 // Incorrect argument types 2151 checkNPE(() -> { // null array 2152 $type$ x = ($type$) vh.getOpaque(null, 0); 2153 }); 2154 checkCCE(() -> { // array reference class 2155 $type$ x = ($type$) vh.getOpaque(Void.class, 0); 2156 }); 2157 checkWMTE(() -> { // array primitive class 2158 $type$ x = ($type$) vh.getOpaque(0, 0); 2159 }); 2160 checkWMTE(() -> { // index reference class 2161 $type$ x = ($type$) vh.getOpaque(array, Void.class); 2162 }); 2163 // Incorrect return type 2164 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2165 Void x = (Void) vh.getOpaque(array, 0); 2166 }); 2167 checkWMTE(() -> { // primitive class 2168 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getOpaque(array, 0); 2169 }); 2170 // Incorrect arity 2171 checkWMTE(() -> { // 0 2172 $type$ x = ($type$) vh.getOpaque(); 2173 }); 2174 checkWMTE(() -> { // > 2175 $type$ x = ($type$) vh.getOpaque(array, 0, Void.class); 2176 }); 2177 2178 2179 // SetOpaque 2180 // Incorrect argument types 2181 checkNPE(() -> { // null array 2182 vh.setOpaque(null, 0, $value1$); 2183 }); 2184 checkCCE(() -> { // array reference class 2185 vh.setOpaque(Void.class, 0, $value1$); 2186 }); 2187 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2188 vh.setOpaque(array, 0, Void.class); 2189 }); 2190 checkWMTE(() -> { // receiver primitive class 2191 vh.setOpaque(0, 0, $value1$); 2192 }); 2193 checkWMTE(() -> { // index reference class 2194 vh.setOpaque(array, Void.class, $value1$); 2195 }); 2196 // Incorrect arity 2197 checkWMTE(() -> { // 0 2198 vh.setOpaque(); 2199 }); 2200 checkWMTE(() -> { // > 2201 vh.setOpaque(array, 0, $value1$, Void.class); 2202 }); 2203 2204 2205 // GetAcquire 2206 // Incorrect argument types 2207 checkNPE(() -> { // null array 2208 $type$ x = ($type$) vh.getAcquire(null, 0); 2209 }); 2210 checkCCE(() -> { // array reference class 2211 $type$ x = ($type$) vh.getAcquire(Void.class, 0); 2212 }); 2213 checkWMTE(() -> { // array primitive class 2214 $type$ x = ($type$) vh.getAcquire(0, 0); 2215 }); 2216 checkWMTE(() -> { // index reference class 2217 $type$ x = ($type$) vh.getAcquire(array, Void.class); 2218 }); 2219 // Incorrect return type 2220 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2221 Void x = (Void) vh.getAcquire(array, 0); 2222 }); 2223 checkWMTE(() -> { // primitive class 2224 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAcquire(array, 0); 2225 }); 2226 // Incorrect arity 2227 checkWMTE(() -> { // 0 2228 $type$ x = ($type$) vh.getAcquire(); 2229 }); 2230 checkWMTE(() -> { // > 2231 $type$ x = ($type$) vh.getAcquire(array, 0, Void.class); 2232 }); 2233 2234 2235 // SetRelease 2236 // Incorrect argument types 2237 checkNPE(() -> { // null array 2238 vh.setRelease(null, 0, $value1$); 2239 }); 2240 checkCCE(() -> { // array reference class 2241 vh.setRelease(Void.class, 0, $value1$); 2242 }); 2243 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2244 vh.setRelease(array, 0, Void.class); 2245 }); 2246 checkWMTE(() -> { // receiver primitive class 2247 vh.setRelease(0, 0, $value1$); 2248 }); 2249 checkWMTE(() -> { // index reference class 2250 vh.setRelease(array, Void.class, $value1$); 2251 }); 2252 // Incorrect arity 2253 checkWMTE(() -> { // 0 2254 vh.setRelease(); 2255 }); 2256 checkWMTE(() -> { // > 2257 vh.setRelease(array, 0, $value1$, Void.class); 2258 }); 2259 2260 2261 #if[CAS] 2262 // CompareAndSet 2263 // Incorrect argument types 2264 checkNPE(() -> { // null receiver 2265 boolean r = vh.compareAndSet(null, 0, $value1$, $value1$); 2266 }); 2267 checkCCE(() -> { // receiver reference class 2268 boolean r = vh.compareAndSet(Void.class, 0, $value1$, $value1$); 2269 }); 2270 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 2271 boolean r = vh.compareAndSet(array, 0, Void.class, $value1$); 2272 }); 2273 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 2274 boolean r = vh.compareAndSet(array, 0, $value1$, Void.class); 2275 }); 2276 checkWMTE(() -> { // receiver primitive class 2277 boolean r = vh.compareAndSet(0, 0, $value1$, $value1$); 2278 }); 2279 checkWMTE(() -> { // index reference class 2280 boolean r = vh.compareAndSet(array, Void.class, $value1$, $value1$); 2281 }); 2282 // Incorrect arity 2283 checkWMTE(() -> { // 0 2284 boolean r = vh.compareAndSet(); 2285 }); 2286 checkWMTE(() -> { // > 2287 boolean r = vh.compareAndSet(array, 0, $value1$, $value1$, Void.class); 2288 }); 2289 2290 2291 // WeakCompareAndSet 2292 // Incorrect argument types 2293 checkNPE(() -> { // null receiver 2294 boolean r = vh.weakCompareAndSetPlain(null, 0, $value1$, $value1$); 2295 }); 2296 checkCCE(() -> { // receiver reference class 2297 boolean r = vh.weakCompareAndSetPlain(Void.class, 0, $value1$, $value1$); 2298 }); 2299 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 2300 boolean r = vh.weakCompareAndSetPlain(array, 0, Void.class, $value1$); 2301 }); 2302 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 2303 boolean r = vh.weakCompareAndSetPlain(array, 0, $value1$, Void.class); 2304 }); 2305 checkWMTE(() -> { // receiver primitive class 2306 boolean r = vh.weakCompareAndSetPlain(0, 0, $value1$, $value1$); 2307 }); 2308 checkWMTE(() -> { // index reference class 2309 boolean r = vh.weakCompareAndSetPlain(array, Void.class, $value1$, $value1$); 2310 }); 2311 // Incorrect arity 2312 checkWMTE(() -> { // 0 2313 boolean r = vh.weakCompareAndSetPlain(); 2314 }); 2315 checkWMTE(() -> { // > 2316 boolean r = vh.weakCompareAndSetPlain(array, 0, $value1$, $value1$, Void.class); 2317 }); 2318 2319 2320 // WeakCompareAndSetVolatile 2321 // Incorrect argument types 2322 checkNPE(() -> { // null receiver 2323 boolean r = vh.weakCompareAndSet(null, 0, $value1$, $value1$); 2324 }); 2325 checkCCE(() -> { // receiver reference class 2326 boolean r = vh.weakCompareAndSet(Void.class, 0, $value1$, $value1$); 2327 }); 2328 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 2329 boolean r = vh.weakCompareAndSet(array, 0, Void.class, $value1$); 2330 }); 2331 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 2332 boolean r = vh.weakCompareAndSet(array, 0, $value1$, Void.class); 2333 }); 2334 checkWMTE(() -> { // receiver primitive class 2335 boolean r = vh.weakCompareAndSet(0, 0, $value1$, $value1$); 2336 }); 2337 checkWMTE(() -> { // index reference class 2338 boolean r = vh.weakCompareAndSet(array, Void.class, $value1$, $value1$); 2339 }); 2340 // Incorrect arity 2341 checkWMTE(() -> { // 0 2342 boolean r = vh.weakCompareAndSet(); 2343 }); 2344 checkWMTE(() -> { // > 2345 boolean r = vh.weakCompareAndSet(array, 0, $value1$, $value1$, Void.class); 2346 }); 2347 2348 2349 // WeakCompareAndSetAcquire 2350 // Incorrect argument types 2351 checkNPE(() -> { // null receiver 2352 boolean r = vh.weakCompareAndSetAcquire(null, 0, $value1$, $value1$); 2353 }); 2354 checkCCE(() -> { // receiver reference class 2355 boolean r = vh.weakCompareAndSetAcquire(Void.class, 0, $value1$, $value1$); 2356 }); 2357 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 2358 boolean r = vh.weakCompareAndSetAcquire(array, 0, Void.class, $value1$); 2359 }); 2360 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 2361 boolean r = vh.weakCompareAndSetAcquire(array, 0, $value1$, Void.class); 2362 }); 2363 checkWMTE(() -> { // receiver primitive class 2364 boolean r = vh.weakCompareAndSetAcquire(0, 0, $value1$, $value1$); 2365 }); 2366 checkWMTE(() -> { // index reference class 2367 boolean r = vh.weakCompareAndSetAcquire(array, Void.class, $value1$, $value1$); 2368 }); 2369 // Incorrect arity 2370 checkWMTE(() -> { // 0 2371 boolean r = vh.weakCompareAndSetAcquire(); 2372 }); 2373 checkWMTE(() -> { // > 2374 boolean r = vh.weakCompareAndSetAcquire(array, 0, $value1$, $value1$, Void.class); 2375 }); 2376 2377 2378 // WeakCompareAndSetRelease 2379 // Incorrect argument types 2380 checkNPE(() -> { // null receiver 2381 boolean r = vh.weakCompareAndSetRelease(null, 0, $value1$, $value1$); 2382 }); 2383 checkCCE(() -> { // receiver reference class 2384 boolean r = vh.weakCompareAndSetRelease(Void.class, 0, $value1$, $value1$); 2385 }); 2386 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 2387 boolean r = vh.weakCompareAndSetRelease(array, 0, Void.class, $value1$); 2388 }); 2389 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 2390 boolean r = vh.weakCompareAndSetRelease(array, 0, $value1$, Void.class); 2391 }); 2392 checkWMTE(() -> { // receiver primitive class 2393 boolean r = vh.weakCompareAndSetRelease(0, 0, $value1$, $value1$); 2394 }); 2395 checkWMTE(() -> { // index reference class 2396 boolean r = vh.weakCompareAndSetRelease(array, Void.class, $value1$, $value1$); 2397 }); 2398 // Incorrect arity 2399 checkWMTE(() -> { // 0 2400 boolean r = vh.weakCompareAndSetRelease(); 2401 }); 2402 checkWMTE(() -> { // > 2403 boolean r = vh.weakCompareAndSetRelease(array, 0, $value1$, $value1$, Void.class); 2404 }); 2405 2406 2407 // CompareAndExchange 2408 // Incorrect argument types 2409 checkNPE(() -> { // null receiver 2410 $type$ x = ($type$) vh.compareAndExchange(null, 0, $value1$, $value1$); 2411 }); 2412 checkCCE(() -> { // array reference class 2413 $type$ x = ($type$) vh.compareAndExchange(Void.class, 0, $value1$, $value1$); 2414 }); 2415 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 2416 $type$ x = ($type$) vh.compareAndExchange(array, 0, Void.class, $value1$); 2417 }); 2418 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 2419 $type$ x = ($type$) vh.compareAndExchange(array, 0, $value1$, Void.class); 2420 }); 2421 checkWMTE(() -> { // array primitive class 2422 $type$ x = ($type$) vh.compareAndExchange(0, 0, $value1$, $value1$); 2423 }); 2424 checkWMTE(() -> { // index reference class 2425 $type$ x = ($type$) vh.compareAndExchange(array, Void.class, $value1$, $value1$); 2426 }); 2427 // Incorrect return type 2428 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2429 Void r = (Void) vh.compareAndExchange(array, 0, $value1$, $value1$); 2430 }); 2431 checkWMTE(() -> { // primitive class 2432 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchange(array, 0, $value1$, $value1$); 2433 }); 2434 // Incorrect arity 2435 checkWMTE(() -> { // 0 2436 $type$ x = ($type$) vh.compareAndExchange(); 2437 }); 2438 checkWMTE(() -> { // > 2439 $type$ x = ($type$) vh.compareAndExchange(array, 0, $value1$, $value1$, Void.class); 2440 }); 2441 2442 2443 // CompareAndExchangeAcquire 2444 // Incorrect argument types 2445 checkNPE(() -> { // null receiver 2446 $type$ x = ($type$) vh.compareAndExchangeAcquire(null, 0, $value1$, $value1$); 2447 }); 2448 checkCCE(() -> { // array reference class 2449 $type$ x = ($type$) vh.compareAndExchangeAcquire(Void.class, 0, $value1$, $value1$); 2450 }); 2451 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 2452 $type$ x = ($type$) vh.compareAndExchangeAcquire(array, 0, Void.class, $value1$); 2453 }); 2454 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 2455 $type$ x = ($type$) vh.compareAndExchangeAcquire(array, 0, $value1$, Void.class); 2456 }); 2457 checkWMTE(() -> { // array primitive class 2458 $type$ x = ($type$) vh.compareAndExchangeAcquire(0, 0, $value1$, $value1$); 2459 }); 2460 checkWMTE(() -> { // index reference class 2461 $type$ x = ($type$) vh.compareAndExchangeAcquire(array, Void.class, $value1$, $value1$); 2462 }); 2463 // Incorrect return type 2464 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2465 Void r = (Void) vh.compareAndExchangeAcquire(array, 0, $value1$, $value1$); 2466 }); 2467 checkWMTE(() -> { // primitive class 2468 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeAcquire(array, 0, $value1$, $value1$); 2469 }); 2470 // Incorrect arity 2471 checkWMTE(() -> { // 0 2472 $type$ x = ($type$) vh.compareAndExchangeAcquire(); 2473 }); 2474 checkWMTE(() -> { // > 2475 $type$ x = ($type$) vh.compareAndExchangeAcquire(array, 0, $value1$, $value1$, Void.class); 2476 }); 2477 2478 2479 // CompareAndExchangeRelease 2480 // Incorrect argument types 2481 checkNPE(() -> { // null receiver 2482 $type$ x = ($type$) vh.compareAndExchangeRelease(null, 0, $value1$, $value1$); 2483 }); 2484 checkCCE(() -> { // array reference class 2485 $type$ x = ($type$) vh.compareAndExchangeRelease(Void.class, 0, $value1$, $value1$); 2486 }); 2487 check{#if[Class]?CCE:WMTE}(() -> { // expected reference class 2488 $type$ x = ($type$) vh.compareAndExchangeRelease(array, 0, Void.class, $value1$); 2489 }); 2490 check{#if[Class]?CCE:WMTE}(() -> { // actual reference class 2491 $type$ x = ($type$) vh.compareAndExchangeRelease(array, 0, $value1$, Void.class); 2492 }); 2493 checkWMTE(() -> { // array primitive class 2494 $type$ x = ($type$) vh.compareAndExchangeRelease(0, 0, $value1$, $value1$); 2495 }); 2496 checkWMTE(() -> { // index reference class 2497 $type$ x = ($type$) vh.compareAndExchangeRelease(array, Void.class, $value1$, $value1$); 2498 }); 2499 // Incorrect return type 2500 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2501 Void r = (Void) vh.compareAndExchangeRelease(array, 0, $value1$, $value1$); 2502 }); 2503 checkWMTE(() -> { // primitive class 2504 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.compareAndExchangeRelease(array, 0, $value1$, $value1$); 2505 }); 2506 // Incorrect arity 2507 checkWMTE(() -> { // 0 2508 $type$ x = ($type$) vh.compareAndExchangeRelease(); 2509 }); 2510 checkWMTE(() -> { // > 2511 $type$ x = ($type$) vh.compareAndExchangeRelease(array, 0, $value1$, $value1$, Void.class); 2512 }); 2513 2514 2515 // GetAndSet 2516 // Incorrect argument types 2517 checkNPE(() -> { // null array 2518 $type$ x = ($type$) vh.getAndSet(null, 0, $value1$); 2519 }); 2520 checkCCE(() -> { // array reference class 2521 $type$ x = ($type$) vh.getAndSet(Void.class, 0, $value1$); 2522 }); 2523 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2524 $type$ x = ($type$) vh.getAndSet(array, 0, Void.class); 2525 }); 2526 checkWMTE(() -> { // reciarrayever primitive class 2527 $type$ x = ($type$) vh.getAndSet(0, 0, $value1$); 2528 }); 2529 checkWMTE(() -> { // index reference class 2530 $type$ x = ($type$) vh.getAndSet(array, Void.class, $value1$); 2531 }); 2532 // Incorrect return type 2533 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2534 Void r = (Void) vh.getAndSet(array, 0, $value1$); 2535 }); 2536 checkWMTE(() -> { // primitive class 2537 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSet(array, 0, $value1$); 2538 }); 2539 // Incorrect arity 2540 checkWMTE(() -> { // 0 2541 $type$ x = ($type$) vh.getAndSet(); 2542 }); 2543 checkWMTE(() -> { // > 2544 $type$ x = ($type$) vh.getAndSet(array, 0, $value1$, Void.class); 2545 }); 2546 2547 2548 // GetAndSetAcquire 2549 // Incorrect argument types 2550 checkNPE(() -> { // null array 2551 $type$ x = ($type$) vh.getAndSetAcquire(null, 0, $value1$); 2552 }); 2553 checkCCE(() -> { // array reference class 2554 $type$ x = ($type$) vh.getAndSetAcquire(Void.class, 0, $value1$); 2555 }); 2556 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2557 $type$ x = ($type$) vh.getAndSetAcquire(array, 0, Void.class); 2558 }); 2559 checkWMTE(() -> { // reciarrayever primitive class 2560 $type$ x = ($type$) vh.getAndSetAcquire(0, 0, $value1$); 2561 }); 2562 checkWMTE(() -> { // index reference class 2563 $type$ x = ($type$) vh.getAndSetAcquire(array, Void.class, $value1$); 2564 }); 2565 // Incorrect return type 2566 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2567 Void r = (Void) vh.getAndSetAcquire(array, 0, $value1$); 2568 }); 2569 checkWMTE(() -> { // primitive class 2570 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetAcquire(array, 0, $value1$); 2571 }); 2572 // Incorrect arity 2573 checkWMTE(() -> { // 0 2574 $type$ x = ($type$) vh.getAndSetAcquire(); 2575 }); 2576 checkWMTE(() -> { // > 2577 $type$ x = ($type$) vh.getAndSetAcquire(array, 0, $value1$, Void.class); 2578 }); 2579 2580 2581 // GetAndSetRelease 2582 // Incorrect argument types 2583 checkNPE(() -> { // null array 2584 $type$ x = ($type$) vh.getAndSetRelease(null, 0, $value1$); 2585 }); 2586 checkCCE(() -> { // array reference class 2587 $type$ x = ($type$) vh.getAndSetRelease(Void.class, 0, $value1$); 2588 }); 2589 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2590 $type$ x = ($type$) vh.getAndSetRelease(array, 0, Void.class); 2591 }); 2592 checkWMTE(() -> { // reciarrayever primitive class 2593 $type$ x = ($type$) vh.getAndSetRelease(0, 0, $value1$); 2594 }); 2595 checkWMTE(() -> { // index reference class 2596 $type$ x = ($type$) vh.getAndSetRelease(array, Void.class, $value1$); 2597 }); 2598 // Incorrect return type 2599 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2600 Void r = (Void) vh.getAndSetRelease(array, 0, $value1$); 2601 }); 2602 checkWMTE(() -> { // primitive class 2603 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndSetRelease(array, 0, $value1$); 2604 }); 2605 // Incorrect arity 2606 checkWMTE(() -> { // 0 2607 $type$ x = ($type$) vh.getAndSetRelease(); 2608 }); 2609 checkWMTE(() -> { // > 2610 $type$ x = ($type$) vh.getAndSetRelease(array, 0, $value1$, Void.class); 2611 }); 2612 #end[CAS] 2613 2614 #if[AtomicAdd] 2615 // GetAndAdd 2616 // Incorrect argument types 2617 checkNPE(() -> { // null array 2618 $type$ x = ($type$) vh.getAndAdd(null, 0, $value1$); 2619 }); 2620 checkCCE(() -> { // array reference class 2621 $type$ x = ($type$) vh.getAndAdd(Void.class, 0, $value1$); 2622 }); 2623 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2624 $type$ x = ($type$) vh.getAndAdd(array, 0, Void.class); 2625 }); 2626 checkWMTE(() -> { // array primitive class 2627 $type$ x = ($type$) vh.getAndAdd(0, 0, $value1$); 2628 }); 2629 checkWMTE(() -> { // index reference class 2630 $type$ x = ($type$) vh.getAndAdd(array, Void.class, $value1$); 2631 }); 2632 // Incorrect return type 2633 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2634 Void r = (Void) vh.getAndAdd(array, 0, $value1$); 2635 }); 2636 checkWMTE(() -> { // primitive class 2637 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAdd(array, 0, $value1$); 2638 }); 2639 // Incorrect arity 2640 checkWMTE(() -> { // 0 2641 $type$ x = ($type$) vh.getAndAdd(); 2642 }); 2643 checkWMTE(() -> { // > 2644 $type$ x = ($type$) vh.getAndAdd(array, 0, $value1$, Void.class); 2645 }); 2646 2647 2648 // GetAndAddAcquire 2649 // Incorrect argument types 2650 checkNPE(() -> { // null array 2651 $type$ x = ($type$) vh.getAndAddAcquire(null, 0, $value1$); 2652 }); 2653 checkCCE(() -> { // array reference class 2654 $type$ x = ($type$) vh.getAndAddAcquire(Void.class, 0, $value1$); 2655 }); 2656 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2657 $type$ x = ($type$) vh.getAndAddAcquire(array, 0, Void.class); 2658 }); 2659 checkWMTE(() -> { // array primitive class 2660 $type$ x = ($type$) vh.getAndAddAcquire(0, 0, $value1$); 2661 }); 2662 checkWMTE(() -> { // index reference class 2663 $type$ x = ($type$) vh.getAndAddAcquire(array, Void.class, $value1$); 2664 }); 2665 // Incorrect return type 2666 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2667 Void r = (Void) vh.getAndAddAcquire(array, 0, $value1$); 2668 }); 2669 checkWMTE(() -> { // primitive class 2670 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddAcquire(array, 0, $value1$); 2671 }); 2672 // Incorrect arity 2673 checkWMTE(() -> { // 0 2674 $type$ x = ($type$) vh.getAndAddAcquire(); 2675 }); 2676 checkWMTE(() -> { // > 2677 $type$ x = ($type$) vh.getAndAddAcquire(array, 0, $value1$, Void.class); 2678 }); 2679 2680 2681 // GetAndAddRelease 2682 // Incorrect argument types 2683 checkNPE(() -> { // null array 2684 $type$ x = ($type$) vh.getAndAddRelease(null, 0, $value1$); 2685 }); 2686 checkCCE(() -> { // array reference class 2687 $type$ x = ($type$) vh.getAndAddRelease(Void.class, 0, $value1$); 2688 }); 2689 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2690 $type$ x = ($type$) vh.getAndAddRelease(array, 0, Void.class); 2691 }); 2692 checkWMTE(() -> { // array primitive class 2693 $type$ x = ($type$) vh.getAndAddRelease(0, 0, $value1$); 2694 }); 2695 checkWMTE(() -> { // index reference class 2696 $type$ x = ($type$) vh.getAndAddRelease(array, Void.class, $value1$); 2697 }); 2698 // Incorrect return type 2699 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2700 Void r = (Void) vh.getAndAddRelease(array, 0, $value1$); 2701 }); 2702 checkWMTE(() -> { // primitive class 2703 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndAddRelease(array, 0, $value1$); 2704 }); 2705 // Incorrect arity 2706 checkWMTE(() -> { // 0 2707 $type$ x = ($type$) vh.getAndAddRelease(); 2708 }); 2709 checkWMTE(() -> { // > 2710 $type$ x = ($type$) vh.getAndAddRelease(array, 0, $value1$, Void.class); 2711 }); 2712 #end[AtomicAdd] 2713 2714 #if[Bitwise] 2715 // GetAndBitwiseOr 2716 // Incorrect argument types 2717 checkNPE(() -> { // null array 2718 $type$ x = ($type$) vh.getAndBitwiseOr(null, 0, $value1$); 2719 }); 2720 checkCCE(() -> { // array reference class 2721 $type$ x = ($type$) vh.getAndBitwiseOr(Void.class, 0, $value1$); 2722 }); 2723 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2724 $type$ x = ($type$) vh.getAndBitwiseOr(array, 0, Void.class); 2725 }); 2726 checkWMTE(() -> { // array primitive class 2727 $type$ x = ($type$) vh.getAndBitwiseOr(0, 0, $value1$); 2728 }); 2729 checkWMTE(() -> { // index reference class 2730 $type$ x = ($type$) vh.getAndBitwiseOr(array, Void.class, $value1$); 2731 }); 2732 // Incorrect return type 2733 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2734 Void r = (Void) vh.getAndBitwiseOr(array, 0, $value1$); 2735 }); 2736 checkWMTE(() -> { // primitive class 2737 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOr(array, 0, $value1$); 2738 }); 2739 // Incorrect arity 2740 checkWMTE(() -> { // 0 2741 $type$ x = ($type$) vh.getAndBitwiseOr(); 2742 }); 2743 checkWMTE(() -> { // > 2744 $type$ x = ($type$) vh.getAndBitwiseOr(array, 0, $value1$, Void.class); 2745 }); 2746 2747 2748 // GetAndBitwiseOrAcquire 2749 // Incorrect argument types 2750 checkNPE(() -> { // null array 2751 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(null, 0, $value1$); 2752 }); 2753 checkCCE(() -> { // array reference class 2754 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(Void.class, 0, $value1$); 2755 }); 2756 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2757 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(array, 0, Void.class); 2758 }); 2759 checkWMTE(() -> { // array primitive class 2760 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(0, 0, $value1$); 2761 }); 2762 checkWMTE(() -> { // index reference class 2763 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(array, Void.class, $value1$); 2764 }); 2765 // Incorrect return type 2766 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2767 Void r = (Void) vh.getAndBitwiseOrAcquire(array, 0, $value1$); 2768 }); 2769 checkWMTE(() -> { // primitive class 2770 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrAcquire(array, 0, $value1$); 2771 }); 2772 // Incorrect arity 2773 checkWMTE(() -> { // 0 2774 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(); 2775 }); 2776 checkWMTE(() -> { // > 2777 $type$ x = ($type$) vh.getAndBitwiseOrAcquire(array, 0, $value1$, Void.class); 2778 }); 2779 2780 2781 // GetAndBitwiseOrRelease 2782 // Incorrect argument types 2783 checkNPE(() -> { // null array 2784 $type$ x = ($type$) vh.getAndBitwiseOrRelease(null, 0, $value1$); 2785 }); 2786 checkCCE(() -> { // array reference class 2787 $type$ x = ($type$) vh.getAndBitwiseOrRelease(Void.class, 0, $value1$); 2788 }); 2789 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2790 $type$ x = ($type$) vh.getAndBitwiseOrRelease(array, 0, Void.class); 2791 }); 2792 checkWMTE(() -> { // array primitive class 2793 $type$ x = ($type$) vh.getAndBitwiseOrRelease(0, 0, $value1$); 2794 }); 2795 checkWMTE(() -> { // index reference class 2796 $type$ x = ($type$) vh.getAndBitwiseOrRelease(array, Void.class, $value1$); 2797 }); 2798 // Incorrect return type 2799 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2800 Void r = (Void) vh.getAndBitwiseOrRelease(array, 0, $value1$); 2801 }); 2802 checkWMTE(() -> { // primitive class 2803 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseOrRelease(array, 0, $value1$); 2804 }); 2805 // Incorrect arity 2806 checkWMTE(() -> { // 0 2807 $type$ x = ($type$) vh.getAndBitwiseOrRelease(); 2808 }); 2809 checkWMTE(() -> { // > 2810 $type$ x = ($type$) vh.getAndBitwiseOrRelease(array, 0, $value1$, Void.class); 2811 }); 2812 2813 2814 // GetAndBitwiseAnd 2815 // Incorrect argument types 2816 checkNPE(() -> { // null array 2817 $type$ x = ($type$) vh.getAndBitwiseAnd(null, 0, $value1$); 2818 }); 2819 checkCCE(() -> { // array reference class 2820 $type$ x = ($type$) vh.getAndBitwiseAnd(Void.class, 0, $value1$); 2821 }); 2822 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2823 $type$ x = ($type$) vh.getAndBitwiseAnd(array, 0, Void.class); 2824 }); 2825 checkWMTE(() -> { // array primitive class 2826 $type$ x = ($type$) vh.getAndBitwiseAnd(0, 0, $value1$); 2827 }); 2828 checkWMTE(() -> { // index reference class 2829 $type$ x = ($type$) vh.getAndBitwiseAnd(array, Void.class, $value1$); 2830 }); 2831 // Incorrect return type 2832 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2833 Void r = (Void) vh.getAndBitwiseAnd(array, 0, $value1$); 2834 }); 2835 checkWMTE(() -> { // primitive class 2836 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAnd(array, 0, $value1$); 2837 }); 2838 // Incorrect arity 2839 checkWMTE(() -> { // 0 2840 $type$ x = ($type$) vh.getAndBitwiseAnd(); 2841 }); 2842 checkWMTE(() -> { // > 2843 $type$ x = ($type$) vh.getAndBitwiseAnd(array, 0, $value1$, Void.class); 2844 }); 2845 2846 2847 // GetAndBitwiseAndAcquire 2848 // Incorrect argument types 2849 checkNPE(() -> { // null array 2850 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(null, 0, $value1$); 2851 }); 2852 checkCCE(() -> { // array reference class 2853 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(Void.class, 0, $value1$); 2854 }); 2855 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2856 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(array, 0, Void.class); 2857 }); 2858 checkWMTE(() -> { // array primitive class 2859 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(0, 0, $value1$); 2860 }); 2861 checkWMTE(() -> { // index reference class 2862 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(array, Void.class, $value1$); 2863 }); 2864 // Incorrect return type 2865 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2866 Void r = (Void) vh.getAndBitwiseAndAcquire(array, 0, $value1$); 2867 }); 2868 checkWMTE(() -> { // primitive class 2869 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndAcquire(array, 0, $value1$); 2870 }); 2871 // Incorrect arity 2872 checkWMTE(() -> { // 0 2873 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(); 2874 }); 2875 checkWMTE(() -> { // > 2876 $type$ x = ($type$) vh.getAndBitwiseAndAcquire(array, 0, $value1$, Void.class); 2877 }); 2878 2879 2880 // GetAndBitwiseAndRelease 2881 // Incorrect argument types 2882 checkNPE(() -> { // null array 2883 $type$ x = ($type$) vh.getAndBitwiseAndRelease(null, 0, $value1$); 2884 }); 2885 checkCCE(() -> { // array reference class 2886 $type$ x = ($type$) vh.getAndBitwiseAndRelease(Void.class, 0, $value1$); 2887 }); 2888 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2889 $type$ x = ($type$) vh.getAndBitwiseAndRelease(array, 0, Void.class); 2890 }); 2891 checkWMTE(() -> { // array primitive class 2892 $type$ x = ($type$) vh.getAndBitwiseAndRelease(0, 0, $value1$); 2893 }); 2894 checkWMTE(() -> { // index reference class 2895 $type$ x = ($type$) vh.getAndBitwiseAndRelease(array, Void.class, $value1$); 2896 }); 2897 // Incorrect return type 2898 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2899 Void r = (Void) vh.getAndBitwiseAndRelease(array, 0, $value1$); 2900 }); 2901 checkWMTE(() -> { // primitive class 2902 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseAndRelease(array, 0, $value1$); 2903 }); 2904 // Incorrect arity 2905 checkWMTE(() -> { // 0 2906 $type$ x = ($type$) vh.getAndBitwiseAndRelease(); 2907 }); 2908 checkWMTE(() -> { // > 2909 $type$ x = ($type$) vh.getAndBitwiseAndRelease(array, 0, $value1$, Void.class); 2910 }); 2911 2912 2913 // GetAndBitwiseXor 2914 // Incorrect argument types 2915 checkNPE(() -> { // null array 2916 $type$ x = ($type$) vh.getAndBitwiseXor(null, 0, $value1$); 2917 }); 2918 checkCCE(() -> { // array reference class 2919 $type$ x = ($type$) vh.getAndBitwiseXor(Void.class, 0, $value1$); 2920 }); 2921 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2922 $type$ x = ($type$) vh.getAndBitwiseXor(array, 0, Void.class); 2923 }); 2924 checkWMTE(() -> { // array primitive class 2925 $type$ x = ($type$) vh.getAndBitwiseXor(0, 0, $value1$); 2926 }); 2927 checkWMTE(() -> { // index reference class 2928 $type$ x = ($type$) vh.getAndBitwiseXor(array, Void.class, $value1$); 2929 }); 2930 // Incorrect return type 2931 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2932 Void r = (Void) vh.getAndBitwiseXor(array, 0, $value1$); 2933 }); 2934 checkWMTE(() -> { // primitive class 2935 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXor(array, 0, $value1$); 2936 }); 2937 // Incorrect arity 2938 checkWMTE(() -> { // 0 2939 $type$ x = ($type$) vh.getAndBitwiseXor(); 2940 }); 2941 checkWMTE(() -> { // > 2942 $type$ x = ($type$) vh.getAndBitwiseXor(array, 0, $value1$, Void.class); 2943 }); 2944 2945 2946 // GetAndBitwiseXorAcquire 2947 // Incorrect argument types 2948 checkNPE(() -> { // null array 2949 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(null, 0, $value1$); 2950 }); 2951 checkCCE(() -> { // array reference class 2952 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(Void.class, 0, $value1$); 2953 }); 2954 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2955 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(array, 0, Void.class); 2956 }); 2957 checkWMTE(() -> { // array primitive class 2958 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(0, 0, $value1$); 2959 }); 2960 checkWMTE(() -> { // index reference class 2961 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(array, Void.class, $value1$); 2962 }); 2963 // Incorrect return type 2964 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2965 Void r = (Void) vh.getAndBitwiseXorAcquire(array, 0, $value1$); 2966 }); 2967 checkWMTE(() -> { // primitive class 2968 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorAcquire(array, 0, $value1$); 2969 }); 2970 // Incorrect arity 2971 checkWMTE(() -> { // 0 2972 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(); 2973 }); 2974 checkWMTE(() -> { // > 2975 $type$ x = ($type$) vh.getAndBitwiseXorAcquire(array, 0, $value1$, Void.class); 2976 }); 2977 2978 2979 // GetAndBitwiseXorRelease 2980 // Incorrect argument types 2981 checkNPE(() -> { // null array 2982 $type$ x = ($type$) vh.getAndBitwiseXorRelease(null, 0, $value1$); 2983 }); 2984 checkCCE(() -> { // array reference class 2985 $type$ x = ($type$) vh.getAndBitwiseXorRelease(Void.class, 0, $value1$); 2986 }); 2987 check{#if[Class]?CCE:WMTE}(() -> { // value reference class 2988 $type$ x = ($type$) vh.getAndBitwiseXorRelease(array, 0, Void.class); 2989 }); 2990 checkWMTE(() -> { // array primitive class 2991 $type$ x = ($type$) vh.getAndBitwiseXorRelease(0, 0, $value1$); 2992 }); 2993 checkWMTE(() -> { // index reference class 2994 $type$ x = ($type$) vh.getAndBitwiseXorRelease(array, Void.class, $value1$); 2995 }); 2996 // Incorrect return type 2997 check{#if[Class]?CCE:WMTE}(() -> { // reference class 2998 Void r = (Void) vh.getAndBitwiseXorRelease(array, 0, $value1$); 2999 }); 3000 checkWMTE(() -> { // primitive class 3001 $wrong_primitive_type$ x = ($wrong_primitive_type$) vh.getAndBitwiseXorRelease(array, 0, $value1$); 3002 }); 3003 // Incorrect arity 3004 checkWMTE(() -> { // 0 3005 $type$ x = ($type$) vh.getAndBitwiseXorRelease(); 3006 }); 3007 checkWMTE(() -> { // > 3008 $type$ x = ($type$) vh.getAndBitwiseXorRelease(array, 0, $value1$, Void.class); 3009 }); 3010 #end[Bitwise] 3011 } 3012 3013 static void testArrayWrongMethodType(Handles hs) throws Throwable { 3014 $type$[] array = new $type$[10]; 3015 Arrays.fill(array, $value1$); 3016 3017 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET)) { 3018 // Incorrect argument types 3019 checkNPE(() -> { // null array 3020 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class)). 3021 invokeExact(($type$[]) null, 0); 3022 }); 3023 hs.checkWMTEOrCCE(() -> { // array reference class 3024 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, int.class)). 3025 invokeExact(Void.class, 0); 3026 }); 3027 checkWMTE(() -> { // array primitive class 3028 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, int.class)). 3029 invokeExact(0, 0); 3030 }); 3031 checkWMTE(() -> { // index reference class 3032 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, Class.class)). 3033 invokeExact(array, Void.class); 3034 }); 3035 // Incorrect return type 3036 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 3037 Void x = (Void) hs.get(am, methodType(Void.class, $type$[].class, int.class)). 3038 invokeExact(array, 0); 3039 }); 3040 checkWMTE(() -> { // primitive class 3041 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$[].class, int.class)). 3042 invokeExact(array, 0); 3043 }); 3044 // Incorrect arity 3045 checkWMTE(() -> { // 0 3046 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 3047 invokeExact(); 3048 }); 3049 checkWMTE(() -> { // > 3050 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, Class.class)). 3051 invokeExact(array, 0, Void.class); 3052 }); 3053 } 3054 3055 for (TestAccessMode am : testAccessModesOfType(TestAccessType.SET)) { 3056 // Incorrect argument types 3057 checkNPE(() -> { // null array 3058 hs.get(am, methodType(void.class, $type$[].class, int.class, $type$.class)). 3059 invokeExact(($type$[]) null, 0, $value1$); 3060 }); 3061 hs.checkWMTEOrCCE(() -> { // array reference class 3062 hs.get(am, methodType(void.class, Class.class, int.class, $type$.class)). 3063 invokeExact(Void.class, 0, $value1$); 3064 }); 3065 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 3066 hs.get(am, methodType(void.class, $type$[].class, int.class, Class.class)). 3067 invokeExact(array, 0, Void.class); 3068 }); 3069 checkWMTE(() -> { // receiver primitive class 3070 hs.get(am, methodType(void.class, int.class, int.class, $type$.class)). 3071 invokeExact(0, 0, $value1$); 3072 }); 3073 checkWMTE(() -> { // index reference class 3074 hs.get(am, methodType(void.class, $type$[].class, Class.class, $type$.class)). 3075 invokeExact(array, Void.class, $value1$); 3076 }); 3077 // Incorrect arity 3078 checkWMTE(() -> { // 0 3079 hs.get(am, methodType(void.class)). 3080 invokeExact(); 3081 }); 3082 checkWMTE(() -> { // > 3083 hs.get(am, methodType(void.class, $type$[].class, int.class, Class.class)). 3084 invokeExact(array, 0, $value1$, Void.class); 3085 }); 3086 } 3087 #if[CAS] 3088 for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_SET)) { 3089 // Incorrect argument types 3090 checkNPE(() -> { // null receiver 3091 boolean r = (boolean) hs.get(am, methodType(boolean.class, $type$[].class, int.class, $type$.class, $type$.class)). 3092 invokeExact(($type$[]) null, 0, $value1$, $value1$); 3093 }); 3094 hs.checkWMTEOrCCE(() -> { // receiver reference class 3095 boolean r = (boolean) hs.get(am, methodType(boolean.class, Class.class, int.class, $type$.class, $type$.class)). 3096 invokeExact(Void.class, 0, $value1$, $value1$); 3097 }); 3098 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // expected reference class 3099 boolean r = (boolean) hs.get(am, methodType(boolean.class, $type$[].class, int.class, Class.class, $type$.class)). 3100 invokeExact(array, 0, Void.class, $value1$); 3101 }); 3102 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // actual reference class 3103 boolean r = (boolean) hs.get(am, methodType(boolean.class, $type$[].class, int.class, $type$.class, Class.class)). 3104 invokeExact(array, 0, $value1$, Void.class); 3105 }); 3106 checkWMTE(() -> { // receiver primitive class 3107 boolean r = (boolean) hs.get(am, methodType(boolean.class, int.class, int.class, $type$.class, $type$.class)). 3108 invokeExact(0, 0, $value1$, $value1$); 3109 }); 3110 checkWMTE(() -> { // index reference class 3111 boolean r = (boolean) hs.get(am, methodType(boolean.class, $type$[].class, Class.class, $type$.class, $type$.class)). 3112 invokeExact(array, Void.class, $value1$, $value1$); 3113 }); 3114 // Incorrect arity 3115 checkWMTE(() -> { // 0 3116 boolean r = (boolean) hs.get(am, methodType(boolean.class)). 3117 invokeExact(); 3118 }); 3119 checkWMTE(() -> { // > 3120 boolean r = (boolean) hs.get(am, methodType(boolean.class, $type$[].class, int.class, $type$.class, $type$.class, Class.class)). 3121 invokeExact(array, 0, $value1$, $value1$, Void.class); 3122 }); 3123 } 3124 3125 for (TestAccessMode am : testAccessModesOfType(TestAccessType.COMPARE_AND_EXCHANGE)) { 3126 // Incorrect argument types 3127 checkNPE(() -> { // null receiver 3128 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class, $type$.class)). 3129 invokeExact(($type$[]) null, 0, $value1$, $value1$); 3130 }); 3131 hs.checkWMTEOrCCE(() -> { // array reference class 3132 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, int.class, $type$.class, $type$.class)). 3133 invokeExact(Void.class, 0, $value1$, $value1$); 3134 }); 3135 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // expected reference class 3136 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, Class.class, $type$.class)). 3137 invokeExact(array, 0, Void.class, $value1$); 3138 }); 3139 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // actual reference class 3140 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class, Class.class)). 3141 invokeExact(array, 0, $value1$, Void.class); 3142 }); 3143 checkWMTE(() -> { // array primitive class 3144 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, int.class, $type$.class, $type$.class)). 3145 invokeExact(0, 0, $value1$, $value1$); 3146 }); 3147 checkWMTE(() -> { // index reference class 3148 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, Class.class, $type$.class, $type$.class)). 3149 invokeExact(array, Void.class, $value1$, $value1$); 3150 }); 3151 // Incorrect return type 3152 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 3153 Void r = (Void) hs.get(am, methodType(Void.class, $type$[].class, int.class, $type$.class, $type$.class)). 3154 invokeExact(array, 0, $value1$, $value1$); 3155 }); 3156 checkWMTE(() -> { // primitive class 3157 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$[].class, int.class, $type$.class, $type$.class)). 3158 invokeExact(array, 0, $value1$, $value1$); 3159 }); 3160 // Incorrect arity 3161 checkWMTE(() -> { // 0 3162 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 3163 invokeExact(); 3164 }); 3165 checkWMTE(() -> { // > 3166 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class, $type$.class, Class.class)). 3167 invokeExact(array, 0, $value1$, $value1$, Void.class); 3168 }); 3169 } 3170 3171 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_SET)) { 3172 // Incorrect argument types 3173 checkNPE(() -> { // null array 3174 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class)). 3175 invokeExact(($type$[]) null, 0, $value1$); 3176 }); 3177 hs.checkWMTEOrCCE(() -> { // array reference class 3178 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, int.class, $type$.class)). 3179 invokeExact(Void.class, 0, $value1$); 3180 }); 3181 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 3182 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, Class.class)). 3183 invokeExact(array, 0, Void.class); 3184 }); 3185 checkWMTE(() -> { // array primitive class 3186 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, int.class, $type$.class)). 3187 invokeExact(0, 0, $value1$); 3188 }); 3189 checkWMTE(() -> { // index reference class 3190 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, Class.class, $type$.class)). 3191 invokeExact(array, Void.class, $value1$); 3192 }); 3193 // Incorrect return type 3194 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 3195 Void r = (Void) hs.get(am, methodType(Void.class, $type$[].class, int.class, $type$.class)). 3196 invokeExact(array, 0, $value1$); 3197 }); 3198 checkWMTE(() -> { // primitive class 3199 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$[].class, int.class, $type$.class)). 3200 invokeExact(array, 0, $value1$); 3201 }); 3202 // Incorrect arity 3203 checkWMTE(() -> { // 0 3204 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 3205 invokeExact(); 3206 }); 3207 checkWMTE(() -> { // > 3208 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class, Class.class)). 3209 invokeExact(array, 0, $value1$, Void.class); 3210 }); 3211 } 3212 #end[CAS] 3213 3214 #if[AtomicAdd] 3215 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_ADD)) { 3216 // Incorrect argument types 3217 checkNPE(() -> { // null array 3218 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class)). 3219 invokeExact(($type$[]) null, 0, $value1$); 3220 }); 3221 hs.checkWMTEOrCCE(() -> { // array reference class 3222 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, int.class, $type$.class)). 3223 invokeExact(Void.class, 0, $value1$); 3224 }); 3225 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 3226 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, Class.class)). 3227 invokeExact(array, 0, Void.class); 3228 }); 3229 checkWMTE(() -> { // array primitive class 3230 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, int.class, $type$.class)). 3231 invokeExact(0, 0, $value1$); 3232 }); 3233 checkWMTE(() -> { // index reference class 3234 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, Class.class, $type$.class)). 3235 invokeExact(array, Void.class, $value1$); 3236 }); 3237 // Incorrect return type 3238 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 3239 Void r = (Void) hs.get(am, methodType(Void.class, $type$[].class, int.class, $type$.class)). 3240 invokeExact(array, 0, $value1$); 3241 }); 3242 checkWMTE(() -> { // primitive class 3243 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$[].class, int.class, $type$.class)). 3244 invokeExact(array, 0, $value1$); 3245 }); 3246 // Incorrect arity 3247 checkWMTE(() -> { // 0 3248 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 3249 invokeExact(); 3250 }); 3251 checkWMTE(() -> { // > 3252 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class, Class.class)). 3253 invokeExact(array, 0, $value1$, Void.class); 3254 }); 3255 } 3256 #end[AtomicAdd] 3257 3258 #if[Bitwise] 3259 for (TestAccessMode am : testAccessModesOfType(TestAccessType.GET_AND_BITWISE)) { 3260 // Incorrect argument types 3261 checkNPE(() -> { // null array 3262 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class)). 3263 invokeExact(($type$[]) null, 0, $value1$); 3264 }); 3265 hs.checkWMTEOrCCE(() -> { // array reference class 3266 $type$ x = ($type$) hs.get(am, methodType($type$.class, Class.class, int.class, $type$.class)). 3267 invokeExact(Void.class, 0, $value1$); 3268 }); 3269 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // value reference class 3270 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, Class.class)). 3271 invokeExact(array, 0, Void.class); 3272 }); 3273 checkWMTE(() -> { // array primitive class 3274 $type$ x = ($type$) hs.get(am, methodType($type$.class, int.class, int.class, $type$.class)). 3275 invokeExact(0, 0, $value1$); 3276 }); 3277 checkWMTE(() -> { // index reference class 3278 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, Class.class, $type$.class)). 3279 invokeExact(array, Void.class, $value1$); 3280 }); 3281 // Incorrect return type 3282 {#if[Class]?hs.checkWMTEOrCCE:checkWMTE}(() -> { // reference class 3283 Void r = (Void) hs.get(am, methodType(Void.class, $type$[].class, int.class, $type$.class)). 3284 invokeExact(array, 0, $value1$); 3285 }); 3286 checkWMTE(() -> { // primitive class 3287 $wrong_primitive_type$ x = ($wrong_primitive_type$) hs.get(am, methodType($wrong_primitive_type$.class, $type$[].class, int.class, $type$.class)). 3288 invokeExact(array, 0, $value1$); 3289 }); 3290 // Incorrect arity 3291 checkWMTE(() -> { // 0 3292 $type$ x = ($type$) hs.get(am, methodType($type$.class)). 3293 invokeExact(); 3294 }); 3295 checkWMTE(() -> { // > 3296 $type$ x = ($type$) hs.get(am, methodType($type$.class, $type$[].class, int.class, $type$.class, Class.class)). 3297 invokeExact(array, 0, $value1$, Void.class); 3298 }); 3299 } 3300 #end[Bitwise] 3301 } 3302 }