[
https://issues.apache.org/jira/browse/NETBEANS-5069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17262652#comment-17262652
]
Akhilesh Singh commented on NETBEANS-5069:
------------------------------------------
After analysis and complete investigation found the issue is with the latest
release of lombok(i.e. 1.18.16), this release unable to resolve the correct
owner-kind for any variable(defined by the annotation @RequiredArgsConstructor
and @setter) on the fly.
*Problematic area*
Consider the below code snippet
{color:#0747a6}_package net.ponec.junitlombok;_{color}
{color:#0747a6}_import lombok.Setter;_{color}
{color:#0747a6} _@Setter_ {color}
{color:#0747a6}_public class Bean {_{color}
{color:#0747a6} _private Integer id;_{color}
{color:#0747a6}_}_{color}
Will convert to the following after process the annotation @Setter
{color:#0747a6}_package net.ponec.junitlombok;_{color}
{color:#0747a6}_import lombok.Setter;_{color}
{color:#0747a6} _@Setter_ {color}
{color:#0747a6}_public class Bean {_{color}
{color:#0747a6} _private Integer id;_{color}
{color:#0747a6}_void setId(final Integer id){_{color}
{color:#0747a6}_this.setId = id;_{color}
{color:#0747a6}_}_{color}
{color:#0747a6}_}_{color}
As per the compilation process, the owner for the method param variable "final
Integer id" is the method "setId" of type MTH. But lombok(1.18.16) considering
this as a null of type NIL. PFB screenshots
!image-2021-01-11-18-50-15-153.png!
!image-2021-01-11-18-54-02-495.png!
Due to the problem of incorrect owner-kind(NIL) the variable "final Integer id"
is not trackable via nbjavac-15 and its setting the address -1 for this
variable. And the compilation of class *Bean* is not successful. The classes
that's uses the Bean class showing compilation error. The example attached in
this defect used @RequiredArgsConstructor annotation, for this owner-kind for
the variable "final Integer id" is Constructor of type MTH coming as a NIL.
Same is not happening with the lombok versions below 1.18.16. Below analysis
performed using lombok 1.18.12
!image-2021-01-11-19-09-26-260.png!
!image-2021-01-11-19-11-33-670.png!
As lombok 1.18.12 processing the annotation @Setter correctly the owner-kind as
MTH for the variable "final Integer id", so there is no problem with the
compilation.
Tested some other annotations also like @Getter and @toString that's working
fine with this version 1.18.16 because there no parameter required to pass for
the method signature *getId(){}* & *toString(){},* so no owner-kind variable
concept exist here.
> Wrong rendering of Lombok classes
> ---------------------------------
>
> Key: NETBEANS-5069
> URL: https://issues.apache.org/jira/browse/NETBEANS-5069
> Project: NetBeans
> Issue Type: Bug
> Affects Versions: 12.1
> Environment: Product Version: Apache NetBeans IDE 12.1
> Java: 11.0.9.1; OpenJDK 64-Bit Server VM 11.0.9.1+12-LTS
> Runtime: OpenJDK Runtime Environment 11.0.9.1+12-LTS
> System: Linux version 5.4.0-54-generic running on amd64; UTF-8; cs_CZ (nb)
> openjdk version "11.0.8" 2020-07-14 LTS
> OpenJDK Runtime Environment Corretto-11.0.8.10.1 (build 11.0.8+10-LTS)
> OpenJDK 64-Bit Server VM Corretto-11.0.8.10.1 (build 11.0.8+10-LTS, mixed
> mode)
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description: Ubuntu 20.04.1 LTS
> Release: 20.04
> Codename: focal
> Reporter: Paul Ponec
> Assignee: Akhilesh Singh
> Priority: Critical
> Attachments: JUnitLombok.zip, Snímek
> obrazovky_2020-11-25_19-49-52_NetBeans-12.1.jpg,
> VirtualBox_2020-12-10_nb12-about.png, VirtualBox_2020-12-10_nb12-about.png,
> VirtualBox_2020-12-10_nb12-bug.png, VirtualBox_2020-12-10_nb12-bug.png,
> image-2021-01-11-18-45-54-202.png, image-2021-01-11-18-46-46-572.png,
> image-2021-01-11-18-47-57-876.png, image-2021-01-11-18-50-15-153.png,
> image-2021-01-11-18-54-02-495.png, image-2021-01-11-18-57-31-301.png,
> image-2021-01-11-19-09-26-260.png, image-2021-01-11-19-11-33-670.png,
> lombok.png
>
>
> The IDE displays false errors in classes affected by Lombok framework. I have
> attached a screenshot and a sample project. Although it might seem that this
> is only a cosmetic mistake, the NetBeans is practically unusable on larger
> projects, and this situation has forced me to temporarily switch to competing
> IDE.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists