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