changeset 1531:9b85813d2262

8002286: Regression: Fix for 8000931 causes a JCK test failure Summary: Wrong type used as 'site' in Resolve.resolveMethod Reviewed-by: jjg
author mcimadamore
date Tue, 06 Nov 2012 14:45:27 +0000
parents 9bce0c73583d
children 8abc56be3131
files src/share/classes/com/sun/tools/javac/comp/Resolve.java test/tools/javac/8002286/T8002286.java test/tools/javac/8002286/T8002286.out
diffstat 3 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Oct 31 10:21:14 2012 -0700
+++ b/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/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/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