Remove Lombok from the code

Description

Lombok has some nice features, but it isn't really Java. To achieve the things it does, it messes with compiler internals, which can and does lead to compatibility problems when switching or upgrading the Java compiler.

This has already caused problems for us when trying to switch to the Eclipse compiler (with its nice incremental compilation) combined with the Eclipse compiler's Groovy support and also with javac when Java 8 was new.

For instance, @lombok.Delegate has been deprecated and marked experimental and "support for this feature may be dropped if future versions of javac or ecj make it difficult to continue to maintain the feature": https://projectlombok.org/features/experimental/Delegate.html

We should switch to an alternative (eg Jackdaw, Immutables, AutoValue) where it makes sense, and simply Delombok the code where there is no practical alternative (eg @Slf4j).

Activity

Show:
Sean Flanigan
January 18, 2017, 6:47 AM

Instead of finding replacements for Lombok's features up front, we are just running Delombok in bulk. This will avoid problems with compilation order when kotlin-maven-plugin is introduced.

Sean Flanigan
August 3, 2016, 11:58 PM
Edited

Replacements (draft, subject to change):

Lombok

Kotlin equiv.

@Delegate(c)

extend a type with by keyword and delegate property

Getter

val/var properties

Setter

var properties

RequiredArgsConstructor

var/val properties in primary constructor (with some default values)

AllArgsConstructor

var/val in primary constructor

NoArgsConstructor

no-arg/jpa plugin for Kotlin compiler

EqualsAndHashCode

see data class

ToString

see data class

AccessLevel

public/private/internal property modifiers

Data

data class with var

Value

data class with val

Wither

data class

Cleanup

"use" extension method

NonNull

A (as opposed to A?)

Ready for Release

Assignee

Sean Flanigan

Reporter

Sean Flanigan

Labels

None

Tested Version/s

None

Story Points

2

Components

Sprint

None

Fix versions

Priority

unspecified