error-prone
error-prone copied to clipboard
Refaster: support method invocation type argument inlining
Within de Picnic codebase we found more situations where "losing" type arguments during a rewrite can lead to non-compilable code. In the example below the explicit type arguments in ImmutableMap.<K, V>builder() currently don't have any effect, as Refaster currently does not support inlining such type arguments for method invocations.
static final class ImmutableMapBuilder<K, V> {
@BeforeTemplate
ImmutableMap.Builder<K, V> before() {
return new ImmutableMap.Builder<>();
}
@AfterTemplate
ImmutableMap.Builder<K, V> after() {
return ImmutableMap.<K, V>builder();
}
}
The changes in this PR resolve this issue.
If desired we can update the test in this PR to use the above example instead of the existing ExecutorService#submit example. @cushon if any other changes are required let us know :).
Rebased and squashed the two commits, as I'll cherry-pick the changes of this PR to our fork. That said: still interested in seeing this included in mainline Error Prone :upside_down_face:.
Rebased. Still curious, could this change still get into mainline Error Prone 😄?
Rebased and added a commit.
Rebased. Is it possible to get this change into mainline Error Prone :smile:?
Rebased.