8219915: [TESTBUG] Fix test langtools/tools/javac/processing/model/completionfailure/SymbolsDontCumulate.java in Standalone mode
Reviewed-by: jlahoda
This commit is contained in:
parent
689760bc12
commit
8bec32b02f
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -24,25 +24,31 @@
|
|||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 8209055
|
* @bug 8209055
|
||||||
* @summary Verify that speculative symbols are not unnecesarily retained in
|
* @summary Verify that speculative symbols are not unnecessarily retained in
|
||||||
* the DeferredCompletionFailureHandler
|
* the DeferredCompletionFailureHandler
|
||||||
* @library /tools/javac/lib /tools/lib
|
* @library /tools/javac/lib /tools/lib
|
||||||
* @modules jdk.compiler/com.sun.tools.javac.api
|
* @modules jdk.compiler/com.sun.tools.javac.api
|
||||||
* jdk.compiler/com.sun.tools.javac.code:+open
|
* jdk.compiler/com.sun.tools.javac.code:+open
|
||||||
|
* jdk.compiler/com.sun.tools.javac.main
|
||||||
* @run main SymbolsDontCumulate
|
* @run main SymbolsDontCumulate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.tools.JavaCompiler;
|
import javax.tools.JavaCompiler;
|
||||||
import javax.tools.StandardJavaFileManager;
|
import javax.tools.StandardJavaFileManager;
|
||||||
import javax.tools.ToolProvider;
|
import javax.tools.ToolProvider;
|
||||||
|
|
||||||
import toolbox.*;
|
|
||||||
import com.sun.tools.javac.api.JavacTaskImpl;
|
import com.sun.tools.javac.api.JavacTaskImpl;
|
||||||
import com.sun.tools.javac.code.DeferredCompletionFailureHandler;
|
import com.sun.tools.javac.code.DeferredCompletionFailureHandler;
|
||||||
|
|
||||||
|
import toolbox.ToolBox;
|
||||||
|
|
||||||
public class SymbolsDontCumulate {
|
public class SymbolsDontCumulate {
|
||||||
ToolBox tb = new ToolBox();
|
ToolBox tb = new ToolBox();
|
||||||
|
|
||||||
@ -65,7 +71,7 @@ public class SymbolsDontCumulate {
|
|||||||
DeferredCompletionFailureHandler h = DeferredCompletionFailureHandler.instance(((JavacTaskImpl) task).getContext());
|
DeferredCompletionFailureHandler h = DeferredCompletionFailureHandler.instance(((JavacTaskImpl) task).getContext());
|
||||||
Field class2Flip = h.userCodeHandler.getClass().getDeclaredField("class2Flip");
|
Field class2Flip = h.userCodeHandler.getClass().getDeclaredField("class2Flip");
|
||||||
class2Flip.setAccessible(true);
|
class2Flip.setAccessible(true);
|
||||||
int size = ((Map) class2Flip.get(h.userCodeHandler)).size();
|
int size = ((Map<?,?>) class2Flip.get(h.userCodeHandler)).size();
|
||||||
assertEquals(0, size);
|
assertEquals(0, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user