Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 134470 Details for
Bug 185422
[1.5][compiler] Incorrectly allows generic use of private inner classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and testcases
patch.txt (text/plain), 5.48 KB, created by
Kent Johnson
on 2009-05-05 13:07:49 EDT
(
hide
)
Description:
Proposed patch and testcases
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2009-05-05 13:07:49 EDT
Size:
5.48 KB
patch
obsolete
>### 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 <T>{\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<X.Baz> {\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<E extends Pool.Entry<E>> {\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<T extends X.Private> {\n" + >@@ -42456,8 +42449,12 @@ > " <U extends X.Private> 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<T extends X.Private> {\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<T> {}\n" + >+ "class B extends A<B.Secret> {\n" + >+ " private class Secret {};\n" + >+ " B.Secret s;\n" + >+ " A<B.Secret> a;\n" + >+ "}\n" + >+ "class C extends B.Secret {}\n" + >+ "class D {\n" + >+ " class M { private class Secret {}; }\n" + >+ " class N extends A<M.Secret> {}\n" + >+ "}\n" + >+ "class E {\n" + >+ " class M extends A<M.Secret> {\n" + >+ " private class Secret {};\n" + >+ " }\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in A.java (at line 2)\n" + >+ " class B extends A<B.Secret> {\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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 185422
: 134470