@Override public void visitPropertyDeclaration(PropertyDeclarationTree tree) { if (!isOnSameLine(tree.property(), tree.colon(), tree.value())) { addPreciseIssue(tree, "Move the property, colon and value to the same line."); } if (isOnSameLine(tree.property(), tree.colon()) && nbWhitespacesBetween(tree.property(), tree.colon()) > 0) { addPreciseIssue(tree.colon(), "Remove the whitespaces between the property and the colon."); } if (isOnSameLine(tree.colon(), tree.value())) { if (nbWhitespacesBetween(tree.colon(), tree.value()) == 0) { addPreciseIssue(tree.colon(), "Add one whitespace between the colon and the value."); } else if (nbWhitespacesBetween(tree.colon(), tree.value()) > 1) { addPreciseIssue(tree.colon(), "Leave only one whitespace between the colon and the value."); } } super.visitPropertyDeclaration(tree); }
@Override public void visitPropertyDeclaration(PropertyDeclarationTree tree) { if (!isOnSameLine(tree.property(), tree.colon(), tree.value())) { addPreciseIssue(tree, "Move the property, colon and value to the same line."); } if (isOnSameLine(tree.property(), tree.colon()) && nbWhitespacesBetween(tree.property(), tree.colon()) > 0) { addPreciseIssue(tree.colon(), "Remove the whitespaces between the property and the colon."); } if (isOnSameLine(tree.colon(), tree.value())) { if (nbWhitespacesBetween(tree.colon(), tree.value()) == 0) { addPreciseIssue(tree.colon(), "Add one whitespace between the colon and the value."); } else if (nbWhitespacesBetween(tree.colon(), tree.value()) > 1) { addPreciseIssue(tree.colon(), "Leave only one whitespace between the colon and the value."); } } super.visitPropertyDeclaration(tree); }