Removed .isArray check, replaced with placeholder

This commit is contained in:
IDoCodingStuffs
2019-02-08 21:04:36 -05:00
parent 97d8faa2ef
commit 834283b34f

View File

@ -14,9 +14,11 @@ public class ArrayInitializationVerbosenessRule extends AbstractJavaRule {
@Override
public Object visit(ASTLocalVariableDeclaration node, Object data) {
if (node.isArray() && node.getImage() != null) {
boolean isArrayPlaceholder = true;
if (isArrayPlaceholder && node.getImage() != null) {
Pattern verbosePattern = Pattern.compile("(= ?new).+\\{");
Matcher matcher = verbosePattern.matcher(string);
Matcher matcher = verbosePattern.matcher(node.getImage());
while (matcher.find()) {
addViolation(data, node);