Lombok-intellij-plugin: @FieldNameConstants Incompatability with lombok 1.18.4

Created on 30 Oct 2018  路  24Comments  路  Source: mplushnikov/lombok-intellij-plugin

Short description

1.18.4 introduced a breaking change for @FieldNameConstants. Generated fields are no longer prefix + fieldName + suffix and instead are generated as just fieldName inside an inner type.

After delombok i am seeing
public static final String nullFIELDnull = "field";

Expected behavior

Generated strings should belong in inner type as

public final class Fields{ public static final String FIELD = "field"; }

See unit test from lombok repo.
Before:
https://github.com/rzwitserloot/lombok/blob/3d432c38d0cfeb36b8e7402eca56faaafcf7bac7/test/transform/resource/before/FieldNameConstantsBasic.java

After:
https://github.com/rzwitserloot/lombok/blob/3d432c38d0cfeb36b8e7402eca56faaafcf7bac7/test/transform/resource/after-delombok/FieldNameConstantsBasic.java

Version information

  • IDEA Version: Build #IU-182.4892.20, built on October 16, 2018

  • JDK Version: JRE: 1.8.0_152-release-1248-b19 amd64

  • OS Type & Version: Windows 7 6.1 *
  • Lombok Plugin Version: 0.22.2018.2
  • Lombok Dependency Version: 1.18.4

Steps to reproduce

_What steps do we need to take to reproduce this issue?_

Simply use @FieldNameConstants with latest version of lombok.

Sample project

Additional information

Stacktrace

enhancement

Most helpful comment

@vrosenshtein: this change will be available in the next release of plugin (version 0.24)

All 24 comments

+1

+1

up

+1

+1

+1

+1

+1

+1

Still facing this problem. Feature is not useable. When it is planned to be fixed?

Are you going to fix it?

+1

I'm having this problem too, but with OpenJDK 11!

+1

I am still having the problem. Tried on versions 1.18.4, 1.18.5 and 1.18.6.

screenshot

@vrosenshtein: this change will be available in the next release of plugin (version 0.24)

@mplushnikov do you know when 0.24 will be released? :) Thanks in advance!

@mplushnikov +1 for Tomasz, fix release would be really appreciated.

+1 also very interested in release date

I would appreciate know the release date please :)

It's released, if someone is still waiting.

Well, just installed 0.25-EAP onto IDEA 2019.1.2. The issue is still here if the lombok dependency is 1.18.4 or 1.18.6. If the lombok is 1.18.2, it's fine of 0.25-EAP (was not working on 0.24 - thanks).
Screenshot 2019-05-09 at 18 27 55

You are right @schernov-xo . You need compatible lombok library for your code of couse.

@mplushnikov just realized that lombok 1.18.6 has another format of Fields class (instead of FIELD_ constants). Did not expect such change in a minor update (since 1.18.2). Seems to be working fine. Thanks!

Was this page helpful?
0 / 5 - 0 ratings