Community
Participate
Working Groups
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0 Build Identifier: 20090621-0832 In the text editor, Eclipse reports compile error "The method paintComponent(Graphics) of type OverrideMethodWrongReport must override or implement a supertype method" if java.awt.Graphics is not imported. This can mislead user, who may spend some time double-checking the method spelling. In this case, the missing import for java.awt.Graphics should be reported first. A code reproducing the problem: import javax.swing.JComponent; public class OverrideMethodWrongReport extends JComponent { @Override protected void paintComponent(Graphics g) { // error message: The method paintComponent(Graphics) of type OverrideMethodWrongReport must override or // implement a supertype method } } Reproducible: Always Steps to Reproduce: 1. In Eclipse, Build ID 20090621-0832: create new class OverrideMethodWrongReport and paste the sample code from this bug Details. 2. Enjoy. 3.
Agree. I think we should not even issue an error in case where the signature is not fully resolved.
Created attachment 151165 [details] proposed fix v0.5 + regression test Created a new field TagBits$HasUnresolvedArguments to flag off error in resolution of method arguments. If this flag is set then we dont report override annotation error. Added regression test AnnotationTest#test278()
+1. Refactored the code a bit. Released for 3.6M4. Regression test added in: org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest#test278 Thanks Ayushman.
Verified for 3.6M4 using I20091207-1800