Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 381198 - [@Data] missing warning for marking members non-final explicitly
Summary: [@Data] missing warning for marking members non-final explicitly
Status: VERIFIED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: v2.7
Keywords:
Depends on: 437509
Blocks:
  Show dependency tree
 
Reported: 2012-05-31 10:01 EDT by Moritz Eysholdt CLA
Modified: 2014-08-28 07:44 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2012-05-31 10:01:38 EDT
Example:
-----------------
@Data
class Foo {
	val String a
}
-----------------

this is semantically equivalent to

-----------------
@Data
class Foo {
	String a
}
-----------------

because @Date implies that all member fields of the class are final.

Therefore, it might be helpful to raise a warning if "val" is specified.
Comment 1 Sebastian Zarnekow CLA 2012-05-31 10:03:13 EDT
I'd expect an error if 'var' is used

Using 'val' explicitly may comunicate better and allows for type inference so a warning is not what I'd like to see.
Comment 2 Sven Efftinge CLA 2014-06-16 04:46:49 EDT
The new @ValueObject annotation should have the error from comment #1.
Comment 3 Stefan Oehme CLA 2014-07-25 05:31:47 EDT
pushed to review
https://git.eclipse.org/r/#/c/30500/
Comment 4 Jan Koehnlein CLA 2014-08-28 07:41:36 EDT
Verified for the new @Data. Nothing changed for  the deprecated one. I guess that's what Sven meant.
Comment 5 Stefan Oehme CLA 2014-08-28 07:44:25 EDT
Yes, the new @Data was initially meant to be called @ValueObject. And yes, we are no longer investing any effort in the old @Data.