From 22af64a28c88c3e5cd97caeb86c266edd9167887 Mon Sep 17 00:00:00 2001 From: Ruslan Diachenko Date: Sat, 29 Aug 2015 20:23:06 +0100 Subject: [PATCH] Issue #1566: 'missing javadoc comment' violations fixed for Check, JavadocNodeImpl --- .../tools/checkstyle/api/Check.java | 10 +++++-- .../checks/javadoc/JavadocNodeImpl.java | 29 ++++++++++++++++++- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java index ce962428b..e8050dbe5 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java @@ -51,11 +51,15 @@ public abstract class Check extends AbstractViolationReporter { private int tabWidth = DEFAULT_TAB_WIDTH; /** - * The class loader to load external classes. Not initialised as this must + * The class loader to load external classes. Not initialized as this must * be set by my creator. */ private ClassLoader classLoader; + /** + * Whether comment nodes are required or not. + * @return false as a default value. + */ public boolean isCommentNodesRequired() { return false; } @@ -117,7 +121,7 @@ public abstract class Check extends AbstractViolationReporter { } /** - * Initialise the check. This is the time to verify that the check has + * Initialize the check. This is the time to verify that the check has * everything required to perform it job. */ public void init() { @@ -132,7 +136,7 @@ public abstract class Check extends AbstractViolationReporter { } /** - * Called before the starting to process a tree. Ideal place to initialise + * Called before the starting to process a tree. Ideal place to initialize * information that is to be collected whilst processing a tree. * @param rootAST the root of the tree */ diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java index 0c882f999..af78b4167 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java @@ -107,30 +107,58 @@ public class JavadocNodeImpl implements DetailNode { return index; } + /** + * Sets node's type. + * @param type Node's type. + */ public void setType(int type) { this.type = type; } + /** + * Sets node's text content. + * @param text Node's text content. + */ public void setText(String text) { this.text = text; } + /** + * Sets line number. + * @param lineNumber Line number. + */ public void setLineNumber(int lineNumber) { this.lineNumber = lineNumber; } + /** + * Sets column number. + * @param columnNumber Column number. + */ public void setColumnNumber(int columnNumber) { this.columnNumber = columnNumber; } + /** + * Sets array of child nodes. + * @param children Array of child nodes. + */ public void setChildren(DetailNode... children) { this.children = Arrays.copyOf(children, children.length); } + /** + * Sets parent node. + * @param parent Parent node. + */ public void setParent(DetailNode parent) { this.parent = parent; } + /** + * Sets node's index among parent's children. + * @param index Node's index among parent's children. + */ public void setIndex(int index) { this.index = index; } @@ -140,5 +168,4 @@ public class JavadocNodeImpl implements DetailNode { return JavadocUtils.getTokenName(type) + "[" + lineNumber + "x" + columnNumber + "]"; } - }