8002286: Regression: Fix for 8000931 causes a JCK test failure
authormcimadamore
Tue, 06 Nov 2012 14:45:27 +0000
changeset 14446 88145bb2ddcd
parent 14445 835eb1433d39
child 14447 6f87132c2e54
8002286: Regression: Fix for 8000931 causes a JCK test failure Summary: Wrong type used as 'site' in Resolve.resolveMethod Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
langtools/test/tools/javac/8002286/T8002286.java
langtools/test/tools/javac/8002286/T8002286.out
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Oct 31 10:21:14 2012 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Nov 06 14:45:27 2012 +0000
@@ -2022,7 +2022,7 @@
                          Name name,
                          List<Type> argtypes,
                          List<Type> typeargtypes) {
-        return lookupMethod(env, pos, env.enclClass.sym, new BasicLookupHelper(name, env.enclClass.type, argtypes, typeargtypes) {
+        return lookupMethod(env, pos, env.enclClass.sym, new BasicLookupHelper(name, env.enclClass.sym.type, argtypes, typeargtypes) {
             @Override
             Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
                 return findFun(env, name, argtypes, typeargtypes,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/8002286/T8002286.java	Tue Nov 06 14:45:27 2012 +0000
@@ -0,0 +1,12 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8002286
+ * @summary Resolve should support nested resolution contexts
+ * @compile/fail/ref=T8002286.out -XDrawDiagnostics T8002286.java
+ */
+class T8002286 {
+    @Anno(nonExistent())
+    static class Test { }
+
+    @interface Anno { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/8002286/T8002286.out	Tue Nov 06 14:45:27 2012 +0000
@@ -0,0 +1,3 @@
+T8002286.java:8:22: compiler.err.cant.resolve.location.args: kindname.method, value, , , (compiler.misc.location: kindname.annotation, T8002286.Anno, null)
+T8002286.java:8:11: compiler.err.cant.resolve.location.args: kindname.method, nonExistent, , , (compiler.misc.location: kindname.class, T8002286, null)
+2 errors