Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368575

Summary: No validation error when missing getter and setter for @Property
Product: z_Archived Reporter: Brian Svihovec <svihovec>
Component: EDTAssignee: fahua jin <jinfahua>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jspadea, pharmon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 356388    
Bug Blocks: 363656, 368577    

Description Brian Svihovec CLA 2012-01-13 13:53:52 EST
+++ This bug was initially created as a clone of Bug #356388 +++

i int{@Property{}};

I should get a validation error if my handler containing such a global field does not have a "getI" or "setI" function. Currently there is no validation error when default accessors are expected but missing from the application.

Note that this only needs to happen when the user doesn't specify either of the accessors. If they specify one but not the other, then that means it's a read only or write only field and a default is not used for the omitted property.
Comment 1 Paul Harmon CLA 2012-02-23 20:02:37 EST
I have updated the validators and added a validation proxy for @Property.
Comment 2 Brian Svihovec CLA 2012-04-02 13:00:31 EDT
I do not see any validation errors for 

i int{@Property{}};

in a Basic project using EDT Version: 0.8.0.v201203300902-1DV-FjuJ6QMOF4nynxT88h8G.

I tried a Program and a Handler.
Comment 3 Paul Harmon CLA 2012-06-25 11:16:24 EDT
After discussing with Brian, I think that @Property should only be allowed on fields in an ExternalType. The purpose of @Property is to provide the same type of information to the generators about how to access a field, without the validation rules that check for the getter and setter (since there is no way to know if the getter/setter is defined in the ET).

To keep these 2 annotations separate, we should prevent @Property from being used except on fields in an ET.

We can still allow @EGLProperty on ET fields, however. This is in case someone wants the added validation that this annotation provides
Comment 4 Paul Harmon CLA 2012-07-30 10:10:48 EDT
Rocky,

Just need to add a validator that prevents the use of @Property on fields that are not defined in an externaltype. Just look at how EGLPropertyValidator for an example of how to do this (this validator is invoked when any field specifies the @EGLProperty annotation).
Comment 5 Justin Spadea CLA 2012-07-30 10:28:49 EDT
We should probably wait until the validation extensibility work is complete before writing this validator.
Comment 6 Matt Heitz CLA 2013-01-03 14:43:21 EST
Setting the target milestone to Future for bugs that won't be addressed in 0.8.2.
Comment 7 Justin Spadea CLA 2013-01-07 12:31:02 EST
http://git.eclipse.org/c/edt/org.eclipse.edt.git/commit/?id=994f695d1e23d82b1207b26ea11c0ec746dc4b27

@Property is now only allowed on fields inside external types