-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Checkstyle parsing fails for complex annotations supported by Lombok #4633
Comments
@denizarsan I am getting the following errors in eclipse:
This error is valid and shows the file isn't compilable: Please update your example so it is compilable. Verify output with javac. |
@rnveach You will need to add |
Edit: I see now lombok will generate the getter for me with this annotation. |
We should support all code that compiled by javac , except for know limitations like code in UTF |
if such code is rare case you can skip files from chekstyle consideration by http://checkstyle.sourceforge.net/config_filefilters.html#BeforeExecutionExclusionFileFilter |
Parsing of example passes when Parsing will pass if
Even lombok's guide recommends to use it this way.
https://projectlombok.org/features/experimental/onX
https://stackoverflow.com/a/38059047/1016482 |
@denizarsan @romani My recommendation is we should close this issue as the style of code being written cannot be parsed by javac at all naturally. Users are abusing lombok's pre-compile override to write non-standard JLS code. Here is my example:
The first 2 forms compile fine. The last one doesn't. |
we support only what javac support, user need to exclude such files from validation by Chekstyle, http://checkstyle.sourceforge.net/config_filefilters.html#BeforeExecutionExclusionFileFilter. |
All that is needed is to fix Java code to be JLS compliant. Code should be:
|
$ wget -q https://projectlombok.org/downloads/lombok-1.16.4.jar
$ javac -cp lombok-1.16.4.jar C.java
$ cat C.java
$ cat config.xml
$ java -jar checkstyle-8.0-all.jar -c config.xml C.java
The parsing problems that eventually lead to the exception start from
@__(@Override, @Deprecated)
, which the Lombok annotation processor can process fine, without requiring@__({@Override, @Deprecated})
.The text was updated successfully, but these errors were encountered: