View | Details | Raw Unified | Return to bug 293777
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java (+4 lines)
Lines 54-59 Link Here
54
54
55
		if (this.binding == null) {
55
		if (this.binding == null) {
56
			this.binding = new LocalVariableBinding(this, typeBinding, this.modifiers, true);
56
			this.binding = new LocalVariableBinding(this, typeBinding, this.modifiers, true);
57
		} else if (!this.binding.type.isValidBinding()) {
58
			if (scope.referenceMethod().binding != null) {
59
				scope.referenceMethod().binding.tagBits |= TagBits.HasUnresolvedArguments;
60
			}
57
		}
61
		}
58
		scope.addLocalVariable(this.binding);
62
		scope.addLocalVariable(this.binding);
59
		resolveAnnotations(scope, this.annotations, this.binding);
63
		resolveAnnotations(scope, this.annotations, this.binding);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java (-1 / +2 lines)
Lines 149-155 Link Here
149
			if (complianceLevel < ClassFileConstants.JDK1_5) break checkOverride;
149
			if (complianceLevel < ClassFileConstants.JDK1_5) break checkOverride;
150
			int bindingModifiers = this.binding.modifiers;
150
			int bindingModifiers = this.binding.modifiers;
151
			boolean hasOverrideAnnotation = (this.binding.tagBits & TagBits.AnnotationOverride) != 0;
151
			boolean hasOverrideAnnotation = (this.binding.tagBits & TagBits.AnnotationOverride) != 0;
152
			if (hasOverrideAnnotation) {
152
			boolean hasUnresolvedArguments = (this.binding.tagBits & TagBits.HasUnresolvedArguments) != 0;
153
			if (hasOverrideAnnotation  && !hasUnresolvedArguments) {
153
				// no static method is considered overriding
154
				// no static method is considered overriding
154
				if ((bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccOverriding)) == ExtraCompilerModifiers.AccOverriding)
155
				if ((bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccOverriding)) == ExtraCompilerModifiers.AccOverriding)
155
					break checkOverride;
156
					break checkOverride;
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java (+3 lines)
Lines 33-38 Link Here
33
	// for method
33
	// for method
34
	long HasUncheckedTypeArgumentForBoundCheck = ASTNode.Bit9;
34
	long HasUncheckedTypeArgumentForBoundCheck = ASTNode.Bit9;
35
	
35
	
36
	// set when method has argument(s) that couldn't be resolved
37
	long HasUnresolvedArguments = ASTNode.Bit10;
38
	
36
	// for the type cycle hierarchy check used by ClassScope
39
	// for the type cycle hierarchy check used by ClassScope
37
	long BeginHierarchyCheck = ASTNode.Bit9;  // type
40
	long BeginHierarchyCheck = ASTNode.Bit9;  // type
38
	long EndHierarchyCheck = ASTNode.Bit10; // type
41
	long EndHierarchyCheck = ASTNode.Bit10; // type
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java (+30 lines)
Lines 9249-9252 Link Here
9249
		"",
9249
		"",
9250
		JavacTestOptions.SKIP);
9250
		JavacTestOptions.SKIP);
9251
}
9251
}
9252
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=293777
9253
// To verify that a misleading warning against @Override annotation is not
9254
// issued in case the method signature has not been resolved properly.
9255
public void test278() {
9256
	String testString [] = new String[] {
9257
			"A.java",
9258
			"import javax.swing.JComponent;\n" +
9259
			"public class A extends JComponent {\n" +
9260
			"   @Override\n" +
9261
			"	protected void paintComponent(Graphics g) {" +
9262
			"   }\n" +
9263
			"}\n"
9264
			};
9265
	String expectedOutput =
9266
		"----------\n" +
9267
		"1. WARNING in A.java (at line 2)\n" +
9268
		"	public class A extends JComponent {\n" +
9269
		"	             ^\n" +
9270
		"The serializable class A does not declare a static final serialVersionUID field of type long\n" +
9271
		"----------\n" +
9272
		"2. ERROR in A.java (at line 4)\n" +
9273
		"	protected void paintComponent(Graphics g) {   }\n" +
9274
		"	                              ^^^^^^^^\n" +
9275
		"Graphics cannot be resolved to a type\n" +
9276
		"----------\n";
9277
	this.runNegativeTest(
9278
			testString,
9279
			expectedOutput,
9280
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
9281
}
9252
}
9282
}

Return to bug 293777