Open romani opened 8 years ago
Not sure if it's the same issue, but it also misses cases like:
HashMap<String, String> foo;
foo = new HashMap<String, String>();
Current check is only looking at VARIABLE_DEF
and it looks like it needs to look at LITERAL_NEW
too.
It probably should follow variable declarations and scope similar to RequireThisCheck
.
One issue with:
- this(new HashMap<String, String>(1));
+ this(new HashMap<>(1));
We can't tell if the method parameter is missing type or has wildcard type. This may be a limitation of the check if method/constructor is declared in another file.
This may be a limitation of the check
this is limitation of the whole checkstyle. Check should skip such cases from validation.
Force Diamond check missed following cases: https://github.com/checkstyle/checkstyle/commit/1395a92adb0d8fd0767bee81dc407c5e58b37252
Check: https://github.com/sevntu-checkstyle/sevntu.checkstyle/blob/master/sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/DiamondOperatorForVariableDefinitionCheck.java