### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.354 diff -u -r1.354 Scope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 1 Apr 2009 15:15:04 -0000 1.354 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 5 May 2009 17:05:21 -0000 @@ -1072,7 +1072,7 @@ ReferenceBinding memberType = enclosingType.getMemberType(typeName); if (memberType != null) { unitScope.recordTypeReference(memberType); - if (enclosingSourceType == null + if (enclosingSourceType == null || (this.parent == unitScope && (enclosingSourceType.tagBits & TagBits.TypeVariablesAreConnected) == 0) ? memberType.canBeSeenBy(currentPackage) : memberType.canBeSeenBy(enclosingType, enclosingSourceType)) return memberType; #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v retrieving revision 1.795 diff -u -r1.795 GenericTypeTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 27 Apr 2009 14:57:17 -0000 1.795 +++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 5 May 2009 17:05:27 -0000 @@ -38459,9 +38459,7 @@ } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 public void test1135() { - runConformTest( - // test directory preparation - true /* flush output directory */, + runNegativeTest( new String[] { /* test files */ "X.java", "class Foo {\n" + @@ -38492,13 +38490,12 @@ " } \n" + "}\n", // ================= }, - // compiler results - null /* do not check compiler log */, - // runtime results - "Baz" /* expected output string */, - "" /* expected error string */, - // javac options - JavacTestOptions.EclipseJustification.EclipseBug185422 /* javac test options */); + "----------\n" + + "1. ERROR in X.java (at line 13)\n" + + " public class X extends Foo {\n" + + " ^^^^^\n" + + "The type X.Baz is not visible\n" + + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=154029 public void test1136() { @@ -42388,9 +42385,7 @@ } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation public void test1244() { - runConformTest( - // test directory preparation - true /* flush output directory */, + runNegativeTest( new String[] { /* test files */ "X.java", "public class X {\n" + @@ -42419,13 +42414,12 @@ " protected abstract E delegate();\n" + "}\n", // ================= }, - // compiler results - null /* do not check compiler log */, - // runtime results - "SUCCESS" /* expected output string */, - "" /* expected error string */, - // javac options - JavacTestOptions.EclipseJustification.EclipseBug185422 /* javac test options */); + "----------\n" + + "1. ERROR in X.java (at line 14)\n" + + " abstract class Pool> {\n" + + " ^^^^^^^^^^\n" + + "The type Pool.Entry is not visible\n" + + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation public void test1245() { @@ -42447,8 +42441,7 @@ } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation public void test1246() { - runConformTest( - // test directory preparation + runNegativeTest( new String[] { /* test files */ "X.java", "public class X {\n" + @@ -42456,8 +42449,12 @@ " void foo(U u) {}\n" + "}\n", // ================= }, - // javac options - JavacTestOptions.EclipseJustification.EclipseBug185422 /* javac test options */); + "----------\n" + + "1. ERROR in X.java (at line 1)\n" + + " public class X {\n" + + " ^^^^^^^^^\n" + + "The type X.Private is not visible\n" + + "----------\n"); } //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216558 public void test1247() { @@ -49549,4 +49546,39 @@ "----------\n" ); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=273751 +public void test1452() { + this.runNegativeTest( + new String[] { + "A.java", + "class A {}\n" + + "class B extends A {\n" + + " private class Secret {};\n" + + " B.Secret s;\n" + + " A a;\n" + + "}\n" + + "class C extends B.Secret {}\n" + + "class D {\n" + + " class M { private class Secret {}; }\n" + + " class N extends A {}\n" + + "}\n" + + "class E {\n" + + " class M extends A {\n" + + " private class Secret {};\n" + + " }\n" + + "}" + }, + "----------\n" + + "1. ERROR in A.java (at line 2)\n" + + " class B extends A {\n" + + " ^^^^^^^^\n" + + "The type B.Secret is not visible\n" + + "----------\n" + + "2. ERROR in A.java (at line 7)\n" + + " class C extends B.Secret {}\n" + + " ^^^^^^^^\n" + + "The type B.Secret is not visible\n" + + "----------\n" + ); +} } \ No newline at end of file