-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Lombok does not play nice with Error Prone #2605
Comments
There are two problems here: Lombok does not update the end position table and Error Prone does not skip the generated code. The first one can be fixed but that unfortunately only replaces the exception with an warning/error (at least in some cases). To also remove that one Error Prone has to skip generated code. There is a command-line flag A possible solution is to add |
@Rawi01 Adding Java |
This has to be fixed by error-prone, perhaps try to file a feature request there / search for an existing one to subscribe to. There is nothing we can do, short of extensive hackery of error-prone's internals (well beyond what's reasonable / possible on our side). They need to add the ability to mark some annotation as indicating: "Skip this method, entirely", and then you can tell lombok to generate this annotation. If such a facility already exists - can you reply to this issue with some more details about how to configure it (or, alternatively, perhaps there is e.g. |
Lombok can (and should) add new fields/methods/types to the end position table ( @sergeykad Why should |
Probably, but it won't fix the errorprone situation; at best, combining errorprone+lombok without errorprone having facilities to ignore generated methods results in errorprone raising a ton of irrelevant flags on lombok code (irrelevant, in that none of them are bugs or leaks or otherwise problematic). About I hate this annotation. It is beyond clear that the shepherds of it (oracle/openjdk) cannot be trusted with it. I strongly advocate that all libraries involved stop using it. The only reason lombok can be coerced into generating it at all is because we used to, and we wanted to give an easy upgrade path to those users of lombok who have integrated it into their projects and now cannot easily back out of its use. Thus: We support it, whilst advocating in no uncertain terms that this annotation is bad and should never be used. As a followup, that does mean life is so much harder for communicating the notion of 'generated'. I don't like that errorprone doesn't have a skip annotation, but in their defense, had they 'joined the bandwagon' and built in support for |
Running Error Prone on classes with Lombok annotations (e.g.
@Data
,@Slf4j
) crashes compilation.Here is an example:
google/error-prone#1700
The text was updated successfully, but these errors were encountered: