--- a/langtools/test/tools/javac/scope/HashCollisionTest.java Wed Jul 05 20:44:11 2017 +0200
+++ b/langtools/test/tools/javac/scope/HashCollisionTest.java Mon Aug 03 13:28:39 2015 +0200
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 7004029
+ * @bug 7004029 8131915
* @summary Ensure Scope impl can cope with hash collisions
* @library /tools/javac/lib
* @modules jdk.compiler/com.sun.tools.javac.api
@@ -37,6 +37,7 @@
import java.lang.reflect.*;
import java.io.*;
+import java.util.function.BiConsumer;
import com.sun.source.util.Trees;
import com.sun.tools.javac.api.JavacTrees;
@@ -45,6 +46,8 @@
import com.sun.tools.javac.code.Scope.*;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.tree.JCTree.JCImport;
+import com.sun.tools.javac.tree.TreeMaker;
import static com.sun.tools.javac.code.Kinds.Kind.*;
@@ -57,6 +60,7 @@
// set up basic environment for test
Context context = new Context();
JavacFileManager.preRegister(context); // required by ClassReader which is required by Symtab
+ make = TreeMaker.instance(context);
names = Names.instance(context); // Name.Table impls tied to an instance of Names
symtab = Symtab.instance(context);
trees = JavacTrees.instance(context);
@@ -127,12 +131,14 @@
return sym.kind == TYP;
}
};
- starImportScope.importAll(types, fromScope, typeFilter, false);
+ BiConsumer<JCImport, CompletionFailure> noCompletionFailure =
+ (imp, cf) -> { throw new IllegalStateException(); };
+ starImportScope.importAll(types, fromScope, typeFilter, make.Import(null, false), noCompletionFailure);
dump("imported p", starImportScope);
// 7. Insert the class from 3.
- starImportScope.importAll(types, cc.members_field, typeFilter, false);
+ starImportScope.importAll(types, cc.members_field, typeFilter, make.Import(null, false), noCompletionFailure);
dump("imported ce", starImportScope);
/*
@@ -199,6 +205,7 @@
int MAX_TRIES = 100; // max tries to find a hash clash before giving up.
int scopeHashMask;
+ TreeMaker make;
Names names;
Symtab symtab;
Trees trees;