Rewrite DiamondOperatorCheck
in Spoon
#559
Labels
D-hard
low-priority
pmd
unresolved
Some decisions have not been made yet or it is not obvious what should be detected.
Description
What it does?
For generic calls one can explicitly add the type like this
new ArrayList<String>()
. In many cases explicitly writing the type is redundant, because the compiler can infer it.Current implementation
The implementation is currently done in PMD, but this has several problems:
PMD implements the check by checking each invocation and creating a new one, but with the explicit type removed. If the new invocation works, the type is redundant.
How to implement this in Spoon?
The problem is that spoon does not expose any of the type inference done by jdt and every constructed invocation must set the type manually.
There are some solutions that come to mind to replicate a similar behavior:
The text was updated successfully, but these errors were encountered: