File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
test/jdk/java/lang/invoke Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
3737import java .util .List ;
3838
3939import static java .lang .invoke .MethodHandles .lookup ;
40- import static org .testng .Assert .assertSame ;
40+ import static org .testng .Assert .* ;
4141
4242public class TestVHInvokerCaching {
4343
@@ -74,14 +74,16 @@ class Holder {
7474
7575 MethodHandles .Lookup lookup = lookup ();
7676
77- for (Field field : Holder .class .getFields ()) {
77+ for (Field field : Holder .class .getDeclaredFields ()) {
7878 String fieldName = field .getName ();
7979 Class <?> fieldType = field .getType ();
8080
8181 testHandles .add (MethodHandles .arrayElementVarHandle (fieldType .arrayType ()));
8282 testHandles .add (lookup .findVarHandle (Holder .class , fieldName , fieldType ));
8383 }
8484
85+ assertFalse (testHandles .isEmpty ());
86+
8587 return testHandles .stream ().map (vh -> new Object []{ vh }).toArray (Object [][]::new );
8688 }
8789}
You can’t perform that action at this time.
0 commit comments