Bug 134129 - [1.5][compiler] Duplicate error messages when an annotation value expects a boolean but gets an array
Summary: [1.5][compiler] Duplicate error messages when an annotation value expects a b...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-30 13:44 EST by Steven Bandow CLA
Modified: 2006-04-13 14:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Bandow CLA 2006-03-30 13:44:24 EST
Usage of an array instead of an expected boolean for an annotation value results in duplicate error message:

"Type mismatch: cannot convert from Object[] to boolean"


Repro:  Open the following two files in a java project, then observe the Problems view.  It is not necessary to have an annotation processor.


package pkg;
public @interface Anno {
	boolean b() default false;
}


package pkg;
@Anno(b = {})
public class Test {
}


Notes:  This bug was first found after integrating an APT test from 3.1.1.  The test org.eclipse.jdt.apt.tests.ExceptionHandlingTests.testArrayForBooleanValue() fails in 3.2 but now has a workaround.  I haven't seen this bug with any other flavor of type mismatch.
Comment 1 Philipe Mulet CLA 2006-03-31 04:34:33 EST
Reproduced. Added AnnotationTest#test198
Comment 2 Philipe Mulet CLA 2006-03-31 06:16:01 EST
Tuned error reporting to not issue 2 complaints in presence of faulty array initializer. Change located on MemberPairValue.

Fixed
Comment 3 Frederic Fusier CLA 2006-04-13 14:27:03 EDT
Verified for 3.2 RC1 using build I20060413-0010.