Skip to content

Instantly share code, notes, and snippets.

@chenrui333
Created July 21, 2016 02:05
Show Gist options
  • Save chenrui333/13d69c765154159fa933d32ad74dc479 to your computer and use it in GitHub Desktop.
Save chenrui333/13d69c765154159fa933d32ad74dc479 to your computer and use it in GitHub Desktop.

http://stackoverflow.com/questions/21741166/lombok-alternatives-for-clear-code-without-getters-setters-tostring-constructors/21741964#21741964

I like this one better: http://programmers.stackexchange.com/questions/232971/implementation-difference-between-lombok-autovalue

AutoValue is a standard Java annotation processor, meaning that it uses only the javax.* interfaces for annotation processing. 
Lombok is also an annotation processor, but it references implementation-specific classes in order to do things that standard processors 
cannot. Most notably, it changes the code being generated for source classes, for example by inserting getter and setter methods. 
The standard for annotation processors very deliberately did not allow that because it was felt to violate Java's WYSIWYG qualities.

Because Lombok references nonstandard classes it is much more fragile, in that those classes may change between releases. 
It's also obliged to have two parallel implementations for the two main Java compilers (JDK and Eclipse).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment