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 172392 Details for
Bug 317212
[compiler] Illegal permission to invoke the constructor of a member class of an inaccessible type.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Revised patch
patch.txt (text/plain), 4.90 KB, created by
Srikanth Sankaran
on 2010-06-22 04:44:05 EDT
(
hide
)
Description:
Revised patch
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2010-06-22 04:44:05 EDT
Size:
4.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java,v >retrieving revision 1.99 >diff -u -r1.99 QualifiedAllocationExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 18 Jan 2010 12:40:18 -0000 1.99 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 22 Jun 2010 08:41:50 -0000 >@@ -227,6 +227,7 @@ > > this.constant = Constant.NotAConstant; > TypeBinding enclosingInstanceType = null; >+ ReferenceBinding enclosingInstanceReference = null; > TypeBinding receiverType = null; > boolean hasError = false; > boolean enclosingInstanceContainsCast = false; >@@ -247,6 +248,14 @@ > } else if (this.type instanceof QualifiedTypeReference) { > scope.problemReporter().illegalUsageOfQualifiedTypeReference((QualifiedTypeReference)this.type); > hasError = true; >+ } else if (!(enclosingInstanceReference = (ReferenceBinding) enclosingInstanceType).canBeSeenBy((scope))) { >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=317212 >+ enclosingInstanceType = new ProblemReferenceBinding( >+ enclosingInstanceReference.compoundName, >+ enclosingInstanceReference, >+ ProblemReasons.NotVisible); >+ scope.problemReporter().invalidType(this.enclosingInstance, enclosingInstanceType); >+ hasError = true; > } else { > receiverType = ((SingleTypeReference) this.type).resolveTypeEnclosing(scope, (ReferenceBinding) enclosingInstanceType); > if (receiverType != null && enclosingInstanceContainsCast) { >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java,v >retrieving revision 1.83 >diff -u -r1.83 LookupTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 9 Mar 2010 04:28:15 -0000 1.83 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/LookupTest.java 22 Jun 2010 08:42:15 -0000 >@@ -35,6 +35,10 @@ > public static Test suite() { > return buildAllCompliancesTestSuite(testClass()); > } >+ >+static { >+// TESTS_NAMES = new String [] { "test096" }; >+} > /** > * Non-static member class > */ >@@ -3097,6 +3101,81 @@ > "The type p1.B1 is not visible\n" + > "----------\n"); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id= 317212 >+public void test096() { >+ this.runNegativeTest( >+ new String[] { >+ "p0/B.java",//------------------------------ >+ "package p0;\n" + >+ "public class B {\n" + >+ " public static A m() {\n" + >+ " return new A();\n" + >+ " }\n" + >+ "}\n" + >+ "class A {\n" + >+ " public class M {\n" + >+ " public M() {}\n" + >+ " }\n" + >+ "}\n", >+ "p1/C.java",//------------------------------ >+ "package p1;\n" + >+ "import p0.B;\n" + >+ "public class C {\n" + >+ " public static void main(String[] args) {\n" + >+ " B.m().new M();\n" + >+ " }\n" + >+ "}", >+ }, >+ "----------\n" + >+ "1. ERROR in p1\\C.java (at line 5)\n" + >+ " B.m().new M();\n" + >+ " ^^^^^\n" + >+ "The type p0.A is not visible\n" + >+ "----------\n"); >+} >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id= 317212 >+public void test097() { >+ this.runNegativeTest( >+ new String[] { >+ "B.java",//------------------------------ >+ "public class B {\n" + >+ " public static A m() {\n" + >+ " return new B().new A();\n" + >+ " }\n" + >+ " private class A {\n" + >+ " public class M {\n" + >+ " public M() {}\n" + >+ " }\n" + >+ " }\n" + >+ "}\n" + >+ "class C {\n" + >+ " public static void main(String[] args) {\n" + >+ " B.m().new M();\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. WARNING in B.java (at line 3)\n" + >+ " return new B().new A();\n" + >+ " ^^^^^^^^^^^^^^^\n" + >+ "Access to enclosing constructor B.A() is emulated by a synthetic accessor method\n" + >+ "----------\n" + >+ "2. WARNING in B.java (at line 6)\n" + >+ " public class M {\n" + >+ " ^\n" + >+ "The type B.A.M is never used locally\n" + >+ "----------\n" + >+ "3. WARNING in B.java (at line 7)\n" + >+ " public M() {}\n" + >+ " ^^^\n" + >+ "The constructor B.A.M() is never used locally\n" + >+ "----------\n" + >+ "4. ERROR in B.java (at line 13)\n" + >+ " B.m().new M();\n" + >+ " ^^^^^\n" + >+ "The type B$A is not visible\n" + >+ "----------\n"); >+} > public static Class testClass() { return LookupTest.class; > } > }
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 317212
:
172139
|
172209
|
172386
| 172392