-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy Getter + NetBeans = Error parsing file #1696
Comments
Can you add the whole file that produces this problem? I can't understand what or where is your |
The original field should be replaced by the
This would surely be wrong. The original field must be simply removed and this works for me. I don't work myself on lombok, but the project maintainers would surely need more details like the used java version and possibly other interfering annotation processors. |
package com.example.lomboklazygetandnb; @lombok.extern.java.Log private static final String NETBEANS = "8.2 patch 2"; private static final String JAVA = "1.8.0_172 x64"; private static final String WINDOWS = "Windows 10 Pro x64"; private static final String NB_SETTINGS = "turn off Compile on Save"; // when set to true NB shows red ! with "Error parsing file." in Projects view private String initCalculated() public static void main(String[] args)
} } |
Hi, this issue still exists with lombok-1.18.18 and Netbeans-12.3. I compile a sample project that reproduces this here: https://github.com/totakura/nb-lombok-lazy-getter |
I also opened a bug report for Netbeans: https://issues.apache.org/jira/browse/NETBEANS-5512 |
When using NetBeans 8.2 with Maven + Lombok with the following code
@getter(lazy = true)
private final String calculated = doCalculate();
private String doCalculate()
{
return this.toString();
}
NetBeans show red ! with "Error parsing file" in Projects view
Also there's (classname).java.err in NB's cache directory with:
ERROR:30:variable calculated is already defined in class lombok_test.LombokTestBean
ERROR:29:cannot find symbol\n symbol\d method get()\n location\d variable calculated of type java.lang.String
Is it because NB sees both "String calculated" and "AtomicReference calculated"?
If so, could you change it so that generated field is called something like "AtomicReference calculatedRef"?
The text was updated successfully, but these errors were encountered: