Bug 79667 - [1.5][annot] value in member pair value must be a constant expression
Summary: [1.5][annot] value in member pair value must be a constant expression
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-29 10:55 EST by Olivier Thomann CLA
Modified: 2004-12-14 17:52 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2004-11-29 10:55:27 EST
When using an annotation inside a NormalAnnotation, the value must be a constant
expression.

@interface I {
    boolean val() default true;
}

public class X {

	boolean bar() {
		return false;
	}
    @I(val = bar()) void foo() {
    }
}
bar() is not a constant expression.
Comment 1 Philipe Mulet CLA 2004-11-29 16:43:52 EST
Added check. 
Regression test: AnnotationTest#test046.
Fixed
Comment 2 Olivier Thomann CLA 2004-12-14 17:52:53 EST
Verified in 200412140800