mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8058728: TEST_BUG: Make java/lang/invoke/LFCaching/LFGarbageCollectedTest.java skip arrayElementSetter and arrayElementGetter methods
Reviewed-by: vlivanov, iignatyev, psandoz
This commit is contained in:
parent
9dd233271c
commit
72e770ad77
1 changed files with 11 additions and 6 deletions
|
@ -31,14 +31,13 @@
|
||||||
* @build TestMethods
|
* @build TestMethods
|
||||||
* @build LambdaFormTestCase
|
* @build LambdaFormTestCase
|
||||||
* @build LFGarbageCollectedTest
|
* @build LFGarbageCollectedTest
|
||||||
* @run main/othervm/timeout=600 -Djava.lang.invoke.MethodHandle.USE_LF_EDITOR=true -DtestLimit=150 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI LFGarbageCollectedTest
|
* @run main/othervm/timeout=600 -Djava.lang.invoke.MethodHandle.USE_LF_EDITOR=true -DtestLimit=150 LFGarbageCollectedTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
import java.lang.ref.PhantomReference;
|
import java.lang.ref.PhantomReference;
|
||||||
import java.lang.ref.ReferenceQueue;
|
import java.lang.ref.ReferenceQueue;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -94,10 +93,16 @@ public final class LFGarbageCollectedTest extends LambdaFormTestCase {
|
||||||
* @param args Accepts no arguments.
|
* @param args Accepts no arguments.
|
||||||
*/
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// The "identity" and "constant" methods should be removed from this test,
|
// The "identity", "constant", "arrayElementGetter" and "arrayElementSetter"
|
||||||
// because their lambda forms are stored in a static filed and are not GC'ed.
|
// methods should be removed from this test,
|
||||||
// There can be only 5 such LFs for each method, so no memory leak happens.
|
// because their lambda forms are stored in a static field and are not GC'ed.
|
||||||
EnumSet<TestMethods> testMethods = EnumSet.complementOf(EnumSet.of(TestMethods.IDENTITY, TestMethods.CONSTANT));
|
// There can be only a finite number of such LFs for each method,
|
||||||
|
// so no memory leak happens.
|
||||||
|
EnumSet<TestMethods> testMethods = EnumSet.complementOf(EnumSet.of(
|
||||||
|
TestMethods.IDENTITY,
|
||||||
|
TestMethods.CONSTANT,
|
||||||
|
TestMethods.ARRAY_ELEMENT_GETTER,
|
||||||
|
TestMethods.ARRAY_ELEMENT_SETTER));
|
||||||
LambdaFormTestCase.runTests(LFGarbageCollectedTest::new, testMethods);
|
LambdaFormTestCase.runTests(LFGarbageCollectedTest::new, testMethods);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue