-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add type arguments in @AfterTemplate
s for builders
#46
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not completely comfortable with reviewing this as I was not in the loop of these problems (type arguments, wiremock, other blockers) and their fixes. Nor do I have a clear overview of which state currently the fork is in and what is currently blocking us. Brain is a bit depleted atm to really get a sense of this.
Do have some feedback that we can discuss already though.
@@ -32,9 +32,13 @@ private ImmutableListMultimapTemplates() {} | |||
/** | |||
* Prefer {@link ImmutableListMultimap#builder()} over the associated constructor on constructions | |||
* that produce a less-specific type. | |||
* | |||
* <p>Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still keep an XXX here. Now it looks like just class Javadoc; not something to take action upon.
Also, see suggestion: Right? I was so confused. Copied this from suggested commit message in upstream.
* <p>Picnic's Error Prone fork supports inlining of method arguments in the `@AfterTemplate`. | |
* <p>Picnic's Error Prone fork supports method invocation type argument inlining in the `@AfterTemplate`. |
These two suggestions apply to all changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it looks like just class Javadoc; not something to take action upon.
That was exactly what was my intention 😄.
Both you and @Stephan202 mention that it should be an XXX
so I updated the Javadoc and added the feedback 😉.
Btw, let me give some extra context on this tomorrow :).
1dd72a3
to
4f28ecb
Compare
Updated the milestone. As discussed offline, we'll merge this PR once |
Dropped this ticket from the upcoming milestone for now. Not because we don't want this change, but because we first need to formulate a solution to the "serialization compatibility question". |
4f28ecb
to
59b2435
Compare
Looks good. No mutations were possible for these changes. |
59b2435
to
d6526d3
Compare
I looked into this again. Rebased it and tried some things. However, I think we need to have a WDYT @Stephan202? |
845901b
to
339152a
Compare
Well, you are right (discussed here) and indeed we cannot use a |
That sounds more complex, but on the plus side would enable also other cleanup. I haven't looked into it deeply, but it would amount to identifying method invocations that (a) specify explicit type parameters and (b) invoke a specific method overload that, absent such type parameters, would also be selected by the algorithm defined by JLS 18.5.2. For (b) we'd of course rely on a few heuristics; just enough to avoid false positives while still covering the cases discussed here. |
While applying
error-prone-support
on repositories within Picnic we found that for some templates we lose generic type information. Therefore, we opened a PR upstream google/error-prone#2706 to fix this. The problem is that for method invocations the type arguments were simply ignored by Refaster in the@AfterTemplate
s.Our fork cherry-picked the commit from the upstream repository. In addition, we also use the fork for Picnic internally.
However, currently we are not on the latest version due to some issues.
This should prepare the code for when we upgrade EPS and PSM to
v2.11.0-picnic-1
or2.11.1
(which doesn't exist yet).