5 ms·
>Getters and setters Meet Project Lombok. Problem solved and forgotten.
by noisem4ker 6y ago
>Getters and setters
Meet Project Lombok. Problem solved and forgotten.
- ivan_gammel 6y agoWell, no, it is not. Lombok does not mask invocations, so it is still foo.getA().getB().getC()
- Vax45 6y agoI prefer Immutables for code generation. Lombok tends to interfere with Eclipse' code evaluations (last time I used it, it kept interfering with searching for a generated method's usage in your code base) and tends to confuse me when trying to figure out if something's an actual method or a method that was injected into the AST during compilation. Immutables has its own set of problems, but at least it uses the standard Annotation processor and has a clear separation of generated code and the interface you write. Haven't used Java's new record's yet, so don't really know anything about that.
- dehrmann 6y agoI can't remember the exact issues, but there's enough magic going on in Lombok that it doesn't play well with Kotlin, so you're better off with Autovalue or Immutables to future-proof things. I also generally don't like how much magic Lombok uses, regardless of if you needs support for any other JVM languages.
- kulig 6y agoAn external dependency for generating getters and setters? Whats next? Dependency to check if a value is null?
- zmmmmm 6y agoAfter spending nearly a whole day trying to get a lombok build configured and working in my IDE ... I just gave up on it. It's a nice idea but I prefer to use something like Groovy where the AST transformations happen directly in the language space rather than in a meta-build step that requires so much IDE involvement. (not to mention most of them not even needed because Groovy just does those conveniences by default).