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
[BUG] ErrorProne compiler reports "MissingSummary" on @SuperBuilder w/ 1.18.18 #2730
Comments
Can confirm that this does not work. |
…ion set. This may fix 'IllegalArgumentException' errors when using google errorprone.
@mmoayyed Can you please test the edge release and report if that resolves the exception? |
Yes, the edge release certainly does remove the exception, but it does not fix the problem. After switching and instead of the stacktrace, I now see the following:
This is what the class structure looks like: @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
@Getter
@SuperBuilder
@ToString
public class AuthenticationPolicyExecutionResult implements Serializable {
private final boolean success;
} I suspect the javadoc that is generated for the |
I started getting these errors for the regular
|
This looks like the current issue we're getting as well. In our case it's Lombok v1.18.24 + errorprone v2.13.1, and we're only using |
This sounds like a linting tool that requires javadoc on some node we generate. A few notes on this:
NB: When I mean 'silly' rule, this is what I mean. Imagine a codebase with this method: /**
* Counts the number of days.
* @return int The number of days.
* @throws IllegalStateException If the object is in a state where counting the number of days doesn't make sense or is not possible.
*/
public int countDays() throws IllegalStateException {
...
} Just clear your mind of the style you've been (forced to / used to) write for a moment. Imagine you have programmed in some other language with different conventions for a second. Now that you've done that, look at that code again. It is a RIDICULOUS pile of DRY violations. It's staggering amount of pointless boilerplate. The entire comment adds absolutely nothing whatsoever. The javadoc tool doesn't skip javadoc-less public members, in fact, even the docs get needlessly polluted with this stuff if you do add the javadoc like the way its written above. In fact, it gets even worse: Code readability and API usability falls in 3 tiers and there's a big gap between all 3 of them:
The problem with forcing javadoc on all nodes is that you 'excuse' type 2 code. Normally the benefit of type 1 code is that it's fairly obvious you wrote type 1 code: You never get the itch to add those docs and even if you think explicitly on what it should read, you can't think of anything that the method name and params themselves are already conveying. However, force javadoc and you lose this. You'd think that at least forcing javadoc prevents type 3 code, but, no it does not. See my example: The javadoc note about |
Yes, ErrorProne is essentially a linting tool. It just plugs into the compiler so that it can run during the compilation process to save some build time. And yes, it does ignore code with the But what's interesting with this one is that we only get the issue when we upgrade Lombok to the current version. The original reporter filed this against 1.18.18; we see it on 1.18.20. If we remain on 1.18.12, we don't get the issue. Actually, I was only upgrading to the newer version to see if it had fixed some other issue with Lombok's generated code. Edit: Additional edit just to say that it's very possible this issue is actually an issue in ErrorProne, because it really looks like it's ignoring the annotation in this case for some reason. If I roll ErrorProne back to an earlier version - that too fixes the issue. So it apparently only occurs when the latest version of both are in use. |
Test repo: https://github.com/hakanai/errorprone-lombok-missingsummary This build deliberately elevates MissingSummary to ERROR to make it easier to see when it fails. If I edit Lombok version to 1.18.16 the build passes. Any later version fails. If I comment out the elevation of MissingSummary to ERROR, the build passes (as it should) and yet when I inspect what IDEA sees when it decompiles the classfile, the code looks exactly the same as the earlier version, including all the annotations. Edit: Also on this project, for some reason, rolling ErrorProne back to 2.4.0 doesn't make it work. So it's behaving subtly differently to our real project somehow. |
Thank you for figuring that one out. Sounds like that took some time! And a test repo to boot. Much appreciated. |
low-prio: While it's probably something we can fix (given the test repo, and that it seems to have worked before), it remains catering to idiotic linting rules. If I could detect that rule was on I'd 'fix' this by emitting a warning that your linting tools are badly configured :) |
What MissingSummary usually flags is where you have put In these cases, it's better to put that description as the summary, because that's what it shows in the summary list at the top of the Javadoc page. https://github.com/google/error-prone/blob/master/docs/bugpattern/javadoc/MissingSummary.md I kind of agree with this particular linter rule. If you're going to put in any description at all, it might as well be written in such a way that it appears in the summary. Also, all previous commentary about it being a DRY violation is a fallacy, because we're talking about what a tool generates, and DRY only applies to what you are manually writing. :) |
No, unless you somehow turned that rule on to apply only to generated code, which you obviously didn't. |
To be clear, my opinion about linting tools is what it is, I mention it to clarify what you can expect us to work on / agree to. Not for you to hold a pointless debate about, hence such commentary will be deleted. If you'd like to hold the discussion, forum, not issue tracker. |
Ran into this again in 2023; so it's clearly not fixed at head. |
You can add |
Describe the bug
ErrorProne compiler
2.5.1
complains aboutMissingSummary
when@SuperBuilder
is used in1.18.18
.To Reproduce
Stacktrace follows:
Expected behavior
Passing build.
Version info (please complete the following information):
Additional context
MissingSummary
with ErrorProne bypasses the issue.The text was updated successfully, but these errors were encountered: