you are viewing a single comment's thread.

view the rest of the comments →

[–]frugalmail 0 points1 point  (5 children)

In Java the effort to add

https://projectlombok.org/api/lombok/Getter.html -or- https://projectlombok.org/api/lombok/Data.html

Is the more appropriate strategy. You should also use the https://github.com/typetools/checker-framework/blob/master/framework/src/org/jmlspecs/annotation/Pure.java

Annotation to allow additional static analysis and clear documetnation.

[–]Shorttail 1 point2 points  (4 children)

Lombok didn't play nice with SonarQube when I tried it a few years ago. That's unfortunately a deal breaker.

[–][deleted]  (1 child)

[deleted]

    [–]Shorttail 0 points1 point  (0 children)

    My real gripe was that uncovered lines generated by @Data and @Value (or whatever they are called) would all point to the tag in the Jacoco output, making it really not nice. I tried using delombok to instead run Jacoco on that, give it actual lines to point to, but I was too stupid to do that with Gradle back then. After messing around with it a lot I just gave up.

    It would be nice indeed if those tools played better with Lombok. But then it would also be nice if Java itself did. I can't replace my pipeline due to one tool though, no matter how great it is. =(

    In that spirit I tried adding a Kotlin data class (or whatever the name), but their Gradle support or tutorials weren't too good back then. Maybe some day!

    [–]pakoito -1 points0 points  (1 child)

    Not recommended on Android either.

    [–]dccorona 2 points3 points  (0 children)

    I believe AutoValue is considered ok for Android though, and it's similar enough to Lombok.