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 119525 Details for
Bug 197271
[compiler] Compile in Eclipse works as expected, but not with JVM 1.6.1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch with testcase for 3.4.2
patch.txt (text/plain), 3.85 KB, created by
Kent Johnson
on 2008-12-04 11:43:16 EST
(
hide
)
Description:
Proposed patch with testcase for 3.4.2
Filename:
MIME Type:
Creator:
Kent Johnson
Created:
2008-12-04 11:43:16 EST
Size:
3.85 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.333.2.5 >diff -u -r1.333.2.5 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 4 Nov 2008 17:04:17 -0000 1.333.2.5 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 4 Dec 2008 16:42:18 -0000 >@@ -1848,6 +1848,16 @@ > if (foundProblemVisible) { > return foundProblem; > } >+ if (methodBinding.isStatic() && methodBinding.isPrivate()) { >+ if (foundProblem != null && foundProblem.problemId() == ProblemReasons.NotVisible) { >+ if (((ProblemMethodBinding) foundProblem).closestMatch == methodBinding) { >+ MethodBinding[] others = receiverType.getMethods(selector); >+ for (int i = 0, l = others.length; i < l; i++) >+ if (!others[i].isPrivate() && others[i] != methodBinding) // visible but not a good match >+ return foundProblem; >+ } >+ } >+ } > if (depth > 0) { > invocationSite.setDepth(depth); > invocationSite.setActualReceiverType(receiverType); >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java,v >retrieving revision 1.36.2.2 >diff -u -r1.36.2.2 InnerEmulationTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 10 Jul 2008 18:15:27 -0000 1.36.2.2 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/InnerEmulationTest.java 4 Dec 2008 16:42:19 -0000 >@@ -6481,6 +6481,53 @@ > IClassFileReader reader = ToolFactory.createDefaultClassFileReader(fileX.getAbsolutePath(), IClassFileReader.CONSTANT_POOL); > assertFalse("Should not be final", Flags.isFinal(reader.getAccessFlags())); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=197271 >+public void test172() throws Exception { >+ this.runNegativeTest( >+ new String[] { >+ "X.java",//======================= >+ "public class X {\n" + >+ " void a() {}\n" + >+ " private static void a(String s) {}\n" + >+ " private void c() {}\n" + >+ " private static void c(String s) {}\n" + >+ " static class M1 extends X {\n" + >+ " public void x() {\n" + >+ " a(null);\n" + >+ " c(null);\n" + >+ " }\n" + >+ " }\n" + >+ " static class M2 {\n" + >+ " public void x() {\n" + >+ " a(null);\n" + >+ " c(null);\n" + >+ " }\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 4)\n" + >+ " private void c() {}\n" + >+ " ^^^\n" + >+ "The method c() from the type X is never used locally\n" + >+ "----------\n" + >+ "2. ERROR in X.java (at line 8)\n" + >+ " a(null);\n" + >+ " ^\n" + >+ "The method a(String) from the type X is not visible\n" + >+ "----------\n" + >+ "3. WARNING in X.java (at line 14)\n" + >+ " a(null);\n" + >+ " ^^^^^^^\n" + >+ "Access to enclosing method a(String) from the type X is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + >+ "----------\n" + >+ "4. WARNING in X.java (at line 15)\n" + >+ " c(null);\n" + >+ " ^^^^^^^\n" + >+ "Access to enclosing method c(String) from the type X is emulated by a synthetic accessor method. Increasing its visibility will improve your performance\n" + >+ "----------\n" >+ ); >+} > public static Class testClass() { > return InnerEmulationTest.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 197271
:
74243
|
119423
| 119525