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 18 January 2017 at 06:47

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 3 August 2016 at 23:58
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

Details

Assignee

Reporter

Tested Version/s

Story Points

Components

Sprint

Fix versions

Priority

More fields

Created 3 August 2016 at 07:49
Updated 27 June 2018 at 02:17
Resolved 31 January 2017 at 00:54