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 126517 Details for
Bug 265571
Abstract method that is not directly used is flagged as unused
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch & test
patch.txt (text/plain), 3.78 KB, created by
Srikanth Sankaran
on 2009-02-24 00:50:52 EST
(
hide
)
Description:
Proposed patch & test
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2009-02-24 00:50:52 EST
Size:
3.78 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java,v >retrieving revision 1.70 >diff -u -r1.70 MethodDeclaration.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java 13 Feb 2009 21:40:39 -0000 1.70 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java 24 Feb 2009 05:36:52 -0000 >@@ -47,7 +47,7 @@ > if (this.binding == null) > return; > >- if (!this.binding.isUsed()) { >+ if (!this.binding.isUsed() && !this.binding.isAbstract()) { > if (this.binding.isPrivate() > || (((this.binding.modifiers & (ExtraCompilerModifiers.AccOverriding|ExtraCompilerModifiers.AccImplementing)) == 0) > && this.binding.isOrEnclosedByPrivateType())) { >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java,v >retrieving revision 1.101 >diff -u -r1.101 MethodVerifier.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 13 Feb 2009 21:40:39 -0000 1.101 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java 24 Feb 2009 05:36:53 -0000 >@@ -210,10 +210,6 @@ > // obligations should qualify as a use. > if (concreteMethod.isOrEnclosedByPrivateType()) > concreteMethod.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed; >- for (int i = abstractMethods.length; --i >= 0;) { >- if (abstractMethods[i].isOrEnclosedByPrivateType()) >- abstractMethods[i].original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed; >- } > } > > /* >#P org.eclipse.jdt.core.tests >Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java >=================================================================== >RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java,v >retrieving revision 1.322 >diff -u -r1.322 NegativeTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 13 Feb 2009 21:40:45 -0000 1.322 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/NegativeTest.java 24 Feb 2009 05:37:14 -0000 >@@ -16596,4 +16596,35 @@ > ); > > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=265571 >+public void test445() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public void v() {\n" + >+ " ConcreteClass tab = new ConcreteClass();\n" + >+ " tab.x();\n" + >+ " }\n" + >+ " private abstract class AbstractClass {\n" + >+ " public abstract void x();\n" + >+ " }\n" + >+ " private class ConcreteClass extends AbstractClass {\n" + >+ " public void x() {\n" + >+ " }\n" + >+ " }\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 3)\n" + >+ " ConcreteClass tab = new ConcreteClass();\n" + >+ " ^^^^^^^^^^^^^^^^^^^\n" + >+ "Access to enclosing constructor X.ConcreteClass() is emulated by a synthetic accessor method\n" + >+ "----------\n" + >+ "2. WARNING in X.java (at line 9)\n" + >+ " private class ConcreteClass extends AbstractClass {\n" + >+ " ^^^^^^^^^^^^^\n" + >+ "Access to enclosing constructor X.AbstractClass() is emulated by a synthetic accessor method\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
Flags:
kent_johnson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 265571
: 126517