Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352355 - Initial array values for fields in annotations ignored
Summary: Initial array values for fields in annotations ignored
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P1 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-18 11:24 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:20 EST (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 Justin Spadea CLA 2011-07-18 11:24:59 EDT
record myannot type annotation
	i int[] = [1,2];
	s string = "foo";
end


Here's the output for myannot.eglxml:

<?xml version="1.0" encoding="iso-8859-1"?>
<AnnotationType ID="1" eClass="org.eclipse.edt.mof.egl.AnnotationType" isAbstract="false" isInterface="false" name="myannot" hasCompileErrors="false" packageName="pkg" >
	<eFields ID="2" eClass="org.eclipse.edt.mof.EField" name="i" eType="org.eclipse.edt.mof.EList&lt;org.eclipse.edt.mof.EInt32&gt;" nullable="false" isTransient="false" containment="true" >
		<declarer IDREF="1"/>
	</eFields>
	<eFields ID="3" eClass="org.eclipse.edt.mof.EField" name="s" eType="org.eclipse.edt.mof.EString" nullable="false" isTransient="false" containment="true" initialValue="foo" >
		<declarer IDREF="1"/>
	</eFields>
</AnnotationType>


As you can see the string field has an initialValue but the array field does not.
Comment 1 Paul Harmon CLA 2011-11-10 14:28:48 EST
I have fixed this. The initial values for annotation fields are now stored as literal expressions. These expressions are then converted to the appropriate java object when the annotationType is instatiated.
Comment 2 Justin Spadea CLA 2011-11-22 15:57:27 EST
Verified