From cf85a72f3decb315c878505f474ae96b35c41431 Mon Sep 17 00:00:00 2001 From: Baratali Izmailov Date: Mon, 31 Aug 2015 11:48:56 -0400 Subject: [PATCH] Issue #1566: Fix for SingleLineJavadoc's violations --- config/checkstyle_checks.xml | 5 +- .../puppycrawl/tools/checkstyle/Checker.java | 12 +++-- .../tools/checkstyle/TreeWalker.java | 8 ++- .../checkstyle/ant/CheckstyleAntTask.java | 52 ++++++++++++++----- .../tools/checkstyle/api/AuditEvent.java | 16 ++++-- .../tools/checkstyle/api/Check.java | 4 +- .../tools/checkstyle/api/DetailAST.java | 12 +++-- .../tools/checkstyle/api/FileContents.java | 8 ++- .../tools/checkstyle/api/FullIdent.java | 12 +++-- .../tools/checkstyle/api/LineColumn.java | 8 ++- .../checkstyle/api/LocalizedMessage.java | 28 +++++++--- .../checkstyle/api/LocalizedMessages.java | 8 ++- .../checks/AbstractFormatCheck.java | 8 ++- .../checks/AbstractTypeAwareCheck.java | 24 ++++++--- .../checkstyle/checks/FileContentsHolder.java | 4 +- .../checks/SuppressWarningsHolder.java | 20 +++++-- .../annotation/AnnotationUseStyleCheck.java | 12 +++-- .../annotation/MissingOverrideCheck.java | 4 +- .../checks/javadoc/JavadocMethodCheck.java | 12 +++-- .../checkstyle/checks/javadoc/JavadocTag.java | 40 ++++++++++---- .../metrics/AbstractClassCouplingCheck.java | 8 ++- .../checks/sizes/MethodCountCheck.java | 4 +- .../SuppressWithNearbyCommentFilter.java | 4 +- .../filters/SuppressionCommentFilter.java | 8 ++- .../checkstyle/gui/AbstractCellEditor.java | 28 +++++++--- .../tools/checkstyle/DebugAuditAdapter.java | 24 ++++++--- 26 files changed, 278 insertions(+), 95 deletions(-) diff --git a/config/checkstyle_checks.xml b/config/checkstyle_checks.xml index 81fb76cf2..f116b0c09 100644 --- a/config/checkstyle_checks.xml +++ b/config/checkstyle_checks.xml @@ -343,15 +343,14 @@ + + - - - diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java b/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java index 60c43a31d..eb4ecf618 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java @@ -292,7 +292,9 @@ public class Checker extends AutomaticBean implements MessageDispatcher { return errorCount; } - /** @param basedir the base directory to strip off in filenames */ + /** + * @param basedir the base directory to strip off in filenames + */ public void setBasedir(String basedir) { this.basedir = basedir; } @@ -395,12 +397,16 @@ public class Checker extends AutomaticBean implements MessageDispatcher { this.moduleFactory = moduleFactory; } - /** @param localeCountry the country to report messages **/ + /** + * @param localeCountry the country to report messages + */ public void setLocaleCountry(String localeCountry) { this.localeCountry = localeCountry; } - /** @param localeLanguage the language to report messages **/ + /** + * @param localeLanguage the language to report messages + */ public void setLocaleLanguage(String localeLanguage) { this.localeLanguage = localeLanguage; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java index 7730938aa..615af706f 100755 --- a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java @@ -123,7 +123,9 @@ public final class TreeWalker setFileExtensions("java"); } - /** @param tabWidth the distance between tab stops */ + /** + * @param tabWidth the distance between tab stops + */ public void setTabWidth(int tabWidth) { this.tabWidth = tabWidth; } @@ -138,7 +140,9 @@ public final class TreeWalker cache.load(); } - /** @param classLoader class loader to resolve classes with. */ + /** + * @param classLoader class loader to resolve classes with. + */ public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java b/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java index 24331aad0..267f67300 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTask.java @@ -123,7 +123,9 @@ public class CheckstyleAntTask extends Task { failureProperty = propertyName; } - /** @param fail whether to fail if a violation is found */ + /** + * @param fail whether to fail if a violation is found + */ public void setFailOnViolation(boolean fail) { failOnViolation = fail; } @@ -190,7 +192,9 @@ public class CheckstyleAntTask extends Task { createClasspath().setRefid(classpathRef); } - /** @return a created path for locating classes */ + /** + * @return a created path for locating classes + */ public Path createClasspath() { if (classpath == null) { classpath = new Path(getProject()); @@ -198,17 +202,23 @@ public class CheckstyleAntTask extends Task { return classpath.createPath(); } - /** @param file the file to be checked */ + /** + * @param file the file to be checked + */ public void setFile(File file) { fileName = file.getAbsolutePath(); } - /** @param file the configuration file to use */ + /** + * @param file the configuration file to use + */ public void setConfig(File file) { setConfigLocation(file.getAbsolutePath()); } - /** @param url the URL of the configuration to use */ + /** + * @param url the URL of the configuration to use + */ public void setConfigURL(URL url) { setConfigLocation(url.toExternalForm()); } @@ -225,7 +235,9 @@ public class CheckstyleAntTask extends Task { configLocation = location; } - /** @param omit whether to omit ignored modules */ + /** + * @param omit whether to omit ignored modules + */ public void setOmitIgnoredModules(boolean omit) { omitIgnoredModules = omit; } @@ -598,27 +610,37 @@ public class CheckstyleAntTask extends Task { /** The property value */ private String value; - /** @return the property key */ + /** + * @return the property key + */ public String getKey() { return key; } - /** @param key sets the property key */ + /** + * @param key sets the property key + */ public void setKey(String key) { this.key = key; } - /** @return the property value */ + /** + * @return the property value + */ public String getValue() { return value; } - /** @param value set the property value */ + /** + * @param value set the property value + */ public void setValue(String value) { this.value = value; } - /** @param file set the property value from a File */ + /** + * @param file set the property value from a File + */ public void setFile(File file) { value = file.getAbsolutePath(); } @@ -629,12 +651,16 @@ public class CheckstyleAntTask extends Task { /** Class name of the listener class */ private String className; - /** @return the class name */ + /** + * @return the class name + */ public String getClassname() { return className; } - /** @param name set the class name */ + /** + * @param name set the class name + */ public void setClassname(String name) { className = name; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java index b967be5e8..dd0b839c5 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java @@ -102,12 +102,16 @@ public final class AuditEvent return localizedMessage.getMessage(); } - /** @return the column associated with the message **/ + /** + * @return the column associated with the message + */ public int getColumn() { return localizedMessage.getColumnNo(); } - /** @return the audit event severity level **/ + /** + * @return the audit event severity level + */ public SeverityLevel getSeverityLevel() { if (localizedMessage == null) { return SeverityLevel.INFO; @@ -125,12 +129,16 @@ public final class AuditEvent return localizedMessage.getModuleId(); } - /** @return the name of the source for the message **/ + /** + * @return the name of the source for the message + */ public String getSourceName() { return localizedMessage.getSourceName(); } - /** @return the localized message **/ + /** + * @return the localized message + */ public LocalizedMessage getLocalizedMessage() { return localizedMessage; } 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 e8050dbe5..a69b69a63 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/Check.java @@ -218,7 +218,9 @@ public abstract class Check extends AbstractViolationReporter { return classLoader; } - /** @return the tab width to report errors with */ + /** + * @return the tab width to report errors with + */ protected final int getTabWidth() { return tabWidth; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailAST.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailAST.java index 943165f11..b6b2857f5 100755 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailAST.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/DetailAST.java @@ -210,7 +210,9 @@ public final class DetailAST extends CommonASTWithHiddenTokens { return parent; } - /** @return the line number **/ + /** + * @return the line number + */ public int getLineNo() { int resultNo = -1; @@ -238,7 +240,9 @@ public final class DetailAST extends CommonASTWithHiddenTokens { this.lineNo = lineNo; } - /** @return the column number **/ + /** + * @return the column number + */ public int getColumnNo() { int resultNo = -1; @@ -266,7 +270,9 @@ public final class DetailAST extends CommonASTWithHiddenTokens { this.columnNo = columnNo; } - /** @return the last child node */ + /** + * @return the last child node + */ public DetailAST getLastChild() { DetailAST ast = getFirstChild(); while (ast != null && ast.getNextSibling() != null) { diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java index d4960b8c9..d542d23d4 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java @@ -231,7 +231,9 @@ public final class FileContents implements CommentListener { return new FileText(text); } - /** @return the lines in the file */ + /** + * @return the lines in the file + */ public String[] getLines() { return text.toLinesArray(); } @@ -245,7 +247,9 @@ public final class FileContents implements CommentListener { return text.get(index); } - /** @return the name of the file */ + /** + * @return the name of the file + */ public String getFileName() { return fileName; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java index 8cc5c155c..cdb77a546 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/FullIdent.java @@ -51,17 +51,23 @@ public final class FullIdent { private FullIdent() { } - /** @return the text **/ + /** + * @return the text + */ public String getText() { return StringUtils.join(elements, ""); } - /** @return the line number **/ + /** + * @return the line number + */ public int getLineNo() { return lineNo; } - /** @return the column number **/ + /** + * @return the column number + */ public int getColumnNo() { return columnNo; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java index 5c11de82c..e4eb62879 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/LineColumn.java @@ -44,12 +44,16 @@ public class LineColumn implements Comparable { this.column = column; } - /** @return the one-based line number */ + /** + * @return the one-based line number + */ public int getLine() { return line; } - /** @return the zero-based column number */ + /** + * @return the zero-based column number + */ public int getColumn() { return column; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java index 1ce67de79..a23217493 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java @@ -241,7 +241,9 @@ public final class LocalizedMessage } } - /** @return the translated message **/ + /** + * @return the translated message + */ public String getMessage() { String message = getCustomMessage(); @@ -299,22 +301,30 @@ public final class LocalizedMessage } } - /** @return the line number **/ + /** + * @return the line number + */ public int getLineNo() { return lineNo; } - /** @return the column number **/ + /** + * @return the column number + */ public int getColumnNo() { return columnNo; } - /** @return the severity level **/ + /** + * @return the severity level + */ public SeverityLevel getSeverityLevel() { return severityLevel; } - /** @return the module identifier. */ + /** + * @return the module identifier. + */ public String getModuleId() { return moduleId; } @@ -329,12 +339,16 @@ public final class LocalizedMessage return key; } - /** @return the name of the source for this LocalizedMessage */ + /** + * @return the name of the source for this LocalizedMessage + */ public String getSourceName() { return sourceClass.getName(); } - /** @param locale the locale to use for localization **/ + /** + * @param locale the locale to use for localization + */ public static void setLocale(Locale locale) { if (Locale.ENGLISH.getLanguage().equals(locale.getLanguage())) { sLocale = Locale.ROOT; diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessages.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessages.java index 1b64f878f..cf7e27976 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessages.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessages.java @@ -32,7 +32,9 @@ public final class LocalizedMessages { /** Contains the messages logged **/ private final Set messages = Sets.newTreeSet(); - /** @return the logged messages **/ + /** + * @return the logged messages + */ public SortedSet getMessages() { return Sets.newTreeSet(messages); } @@ -50,7 +52,9 @@ public final class LocalizedMessages { messages.add(aMsg); } - /** @return the number of messages */ + /** + * @return the number of messages + */ public int size() { return messages.size(); } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractFormatCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractFormatCheck.java index cb4f7382b..575832355 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractFormatCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractFormatCheck.java @@ -81,12 +81,16 @@ public abstract class AbstractFormatCheck updateRegexp(format, compileFlags); } - /** @return the regexp to match against */ + /** + * @return the regexp to match against + */ public final Pattern getRegexp() { return regexp; } - /** @return the regexp format */ + /** + * @return the regexp format + */ public final String getFormat() { return format; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractTypeAwareCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractTypeAwareCheck.java index a844f7701..344d2f82a 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractTypeAwareCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/AbstractTypeAwareCheck.java @@ -200,7 +200,9 @@ public abstract class AbstractTypeAwareCheck extends Check { && parent.isAssignableFrom(child); } - /** @return {@code ClassResolver} for current tree. */ + /** + * @return {@code ClassResolver} for current tree. + */ private ClassResolver getClassResolver() { if (classResolver == null) { classResolver = @@ -403,12 +405,16 @@ public abstract class AbstractTypeAwareCheck extends Check { name = className; } - /** @return class name */ + /** + * @return class name + */ public final Token getName() { return name; } - /** @return {@code Class} associated with an object. */ + /** + * @return {@code Class} associated with an object. + */ public abstract Class getClazz(); } @@ -522,17 +528,23 @@ public abstract class AbstractTypeAwareCheck extends Check { columnNo = fullIdent.getColumnNo(); } - /** @return line number of the token */ + /** + * @return line number of the token + */ public int getLineNo() { return lineNo; } - /** @return column number of the token */ + /** + * @return column number of the token + */ public int getColumnNo() { return columnNo; } - /** @return text of the token */ + /** + * @return text of the token + */ public String getText() { return text; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/FileContentsHolder.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/FileContentsHolder.java index e1000c086..c02763de0 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/FileContentsHolder.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/FileContentsHolder.java @@ -37,7 +37,9 @@ public class FileContentsHolder /** The current file contents. */ private static final ThreadLocal FILE_CONTENTS = new ThreadLocal<>(); - /** @return the current file contents. */ + /** + * @return the current file contents. + */ public static FileContents getContents() { return FILE_CONTENTS.get(); } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java index 0ef4e0168..db3b6fd79 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java @@ -471,27 +471,37 @@ public class SuppressWarningsHolder this.lastColumn = lastColumn; } - /** @return the source name of the suppressed check */ + /** + * @return the source name of the suppressed check + */ public String getCheckName() { return checkName; } - /** @return the first line of the suppression region */ + /** + * @return the first line of the suppression region + */ public int getFirstLine() { return firstLine; } - /** @return the first column of the suppression region */ + /** + * @return the first column of the suppression region + */ public int getFirstColumn() { return firstColumn; } - /** @return the last line of the suppression region */ + /** + * @return the last line of the suppression region + */ public int getLastLine() { return lastLine; } - /** @return the last column of the suppression region */ + /** + * @return the last column of the suppression region + */ public int getLastColumn() { return lastColumn; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java index ebd17564c..ea3de3b2b 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java @@ -165,14 +165,20 @@ public final class AnnotationUseStyleCheck extends Check { //not extending AbstractOptionCheck because check //has more than one option type. - /** @see #setElementStyle(String) */ + /** + * @see #setElementStyle(String) + */ private ElementStyle elementStyle = ElementStyle.COMPACT_NO_ARRAY; //defaulting to NEVER because of the strange compiler behavior - /** @see #setTrailingArrayComma(String) */ + /** + * @see #setTrailingArrayComma(String) + */ private TrailingArrayComma trailingArrayComma = TrailingArrayComma.NEVER; - /** @see #setClosingParens(String) */ + /** + * @see #setClosingParens(String) + */ private ClosingParens closingParens = ClosingParens.NEVER; /** diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java index 47a5682f2..40bad5983 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java @@ -99,7 +99,9 @@ public final class MissingOverrideCheck extends Check { private static final Pattern MATCH_INHERIT_DOC = CommonUtils.createPattern("\\{\\s*@(inheritDoc)\\s*\\}"); - /** @see #setJavaFiveCompatibility(boolean) */ + /** + * @see #setJavaFiveCompatibility(boolean) + */ private boolean javaFiveCompatibility; /** diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java index 8ffb164a3..930f51a66 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java @@ -973,17 +973,23 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck { found = true; } - /** @return whether the exception has throws tag associated with */ + /** + * @return whether the exception has throws tag associated with + */ final boolean isFound() { return found; } - /** @return exception's name */ + /** + * @return exception's name + */ final Token getName() { return classInfo.getName(); } - /** @return class for this exception */ + /** + * @return class for this exception + */ final Class getClazz() { return classInfo.getClazz(); } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTag.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTag.java index 49540ee06..b7b6452ba 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTag.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTag.java @@ -57,22 +57,30 @@ public class JavadocTag { this(line, column, tag, null); } - /** @return the tag string **/ + /** + * @return the tag string + */ public String getTagName() { return tagInfo.getName(); } - /** @return the first argument. null if not set. **/ + /** + * @return the first argument. null if not set. + */ public String getFirstArg() { return firstArg; } - /** @return the line number **/ + /** + * @return the line number + */ public int getLineNo() { return lineNo; } - /** @return the column number */ + /** + * @return the column number + */ public int getColumnNo() { return columnNo; } @@ -83,33 +91,45 @@ public class JavadocTag { + ", firstArg='" + firstArg + "'}"; } - /** @return whether the tag is an 'return' tag **/ + /** + * @return whether the tag is an 'return' tag + */ public boolean isReturnTag() { return tagInfo == JavadocTagInfo.RETURN; } - /** @return whether the tag is an 'param' tag **/ + /** + * @return whether the tag is an 'param' tag + */ public boolean isParamTag() { return tagInfo == JavadocTagInfo.PARAM; } - /** @return whether the tag is an 'throws' or 'exception' tag **/ + /** + * @return whether the tag is an 'throws' or 'exception' tag + */ public boolean isThrowsTag() { return tagInfo == JavadocTagInfo.THROWS || tagInfo == JavadocTagInfo.EXCEPTION; } - /** @return whether the tag is a 'see' or 'inheritDoc' tag **/ + /** + * @return whether the tag is a 'see' or 'inheritDoc' tag + */ public boolean isSeeOrInheritDocTag() { return tagInfo == JavadocTagInfo.SEE || isInheritDocTag(); } - /** @return whether the tag is a 'inheritDoc' tag **/ + /** + * @return whether the tag is a 'inheritDoc' tag + */ public boolean isInheritDocTag() { return tagInfo == JavadocTagInfo.INHERIT_DOC; } - /** @return whether the tag can contain references to imported classes **/ + /** + * @return whether the tag can contain references to imported classes + */ public boolean canReferenceImports() { return tagInfo == JavadocTagInfo.SEE || tagInfo == JavadocTagInfo.LINK diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java index 7ba2c0e74..7716088d3 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java @@ -86,7 +86,9 @@ public abstract class AbstractClassCouplingCheck extends Check { return getRequiredTokens(); } - /** @return allowed complexity. */ + /** + * @return allowed complexity. + */ public final int getMax() { return max; } @@ -112,7 +114,9 @@ public abstract class AbstractClassCouplingCheck extends Check { packageName = ""; } - /** @return message key we use for log violations. */ + /** + * @return message key we use for log violations. + */ protected abstract String getLogMessageId(); @Override diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java index da0fa3d59..80388d079 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheck.java @@ -259,7 +259,9 @@ public final class MethodCountCheck extends Check { } } - /** @return the total number of methods. */ + /** + * @return the total number of methods. + */ int getTotal() { return total; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java index 1bc8b1a18..924dd327c 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java @@ -139,7 +139,9 @@ public class SuppressWithNearbyCommentFilter commentRegexp = CommonUtils.createPattern(format); } - /** @return the FileContents for this filter. */ + /** + * @return the FileContents for this filter. + */ public FileContents getFileContents() { return fileContentsReference.get(); } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java index 201eb7374..e566dbee1 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java @@ -134,7 +134,9 @@ public class SuppressionCommentFilter onRegexp = CommonUtils.createPattern(format); } - /** @return the FileContents for this filter. */ + /** + * @return the FileContents for this filter. + */ public FileContents getFileContents() { return fileContentsReference.get(); } @@ -371,7 +373,9 @@ public class SuppressionCommentFilter } } - /** @return the line number of the tag in the source file. */ + /** + * @return the line number of the tag in the source file. + */ public int getLine() { return line; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/gui/AbstractCellEditor.java b/src/main/java/com/puppycrawl/tools/checkstyle/gui/AbstractCellEditor.java index 653e460f1..24829cdbe 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/gui/AbstractCellEditor.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/gui/AbstractCellEditor.java @@ -44,43 +44,57 @@ public abstract class AbstractCellEditor implements CellEditor { */ private final EventListenerList listenerList = new EventListenerList(); - /** @see CellEditor */ + /** + * @see CellEditor + */ @Override public Object getCellEditorValue() { return null; } - /** @see CellEditor */ + /** + * @see CellEditor + */ @Override public boolean isCellEditable(EventObject e) { return true; } - /** @see CellEditor */ + /** + * @see CellEditor + */ @Override public boolean shouldSelectCell(EventObject anEvent) { return false; } - /** @see CellEditor */ + /** + * @see CellEditor + */ @Override public boolean stopCellEditing() { return true; } - /** @see CellEditor */ + /** + * @see CellEditor + */ @Override public void cancelCellEditing() { // No code, tree is read-only } - /** @see CellEditor */ + /** + * @see CellEditor + */ @Override public void addCellEditorListener(CellEditorListener listener) { listenerList.add(CellEditorListener.class, listener); } - /** @see CellEditor */ + /** + * @see CellEditor + */ @Override public void removeCellEditorListener(CellEditorListener listener) { listenerList.remove(CellEditorListener.class, listener); diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/DebugAuditAdapter.java b/src/test/java/com/puppycrawl/tools/checkstyle/DebugAuditAdapter.java index f5f840de8..97b737149 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/DebugAuditAdapter.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/DebugAuditAdapter.java @@ -20,37 +20,49 @@ class DebugAuditAdapter implements AuditListener { called = false; } - /** @see AuditListener */ + /** + * @see AuditListener + */ @Override public void addError(AuditEvent evt) { called = true; } - /** @see AuditListener */ + /** + * @see AuditListener + */ @Override public void addException(AuditEvent evt, Throwable throwable) { called = true; } - /** @see AuditListener */ + /** + * @see AuditListener + */ @Override public void auditStarted(AuditEvent evt) { called = true; } - /** @see AuditListener */ + /** + * @see AuditListener + */ @Override public void fileStarted(AuditEvent evt) { called = true; } - /** @see AuditListener */ + /** + * @see AuditListener + */ @Override public void auditFinished(AuditEvent evt) { called = true; } - /** @see AuditListener */ + /** + * @see AuditListener + */ @Override public void fileFinished(AuditEvent evt) { called = true;