Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
Issue checkstyle#4722: fix HtmlTagCanBeJavadocTag idea violation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimfadora committed Jul 23, 2017
1 parent e39bcc2 commit 256e6a7
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 26 deletions.
4 changes: 3 additions & 1 deletion config/intellij-idea-inspections.xml
Expand Up @@ -983,7 +983,7 @@
<inspection_tool class="HtmlFormInputWithoutLabel" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="HtmlNonExistentInternetResource" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="HtmlPresentationalElement" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="HtmlTagCanBeJavadocTag" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="HtmlTagCanBeJavadocTag" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="HtmlUnknownAnchorTarget" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="ERROR" enabled_by_default="true">
<option name="myValues">
Expand Down Expand Up @@ -2122,6 +2122,8 @@
<option value="CallToSimpleGetterFromWithinClass" />
<!-- violations in DetailAST will be addressed further -->
<option value="FieldNotUsedInToString" />
<!-- till #4805-->
<option value="HtmlTagCanBeJavadocTag" />
</list>
</option>
</inspection_tool>
Expand Down
Expand Up @@ -83,7 +83,7 @@ public DefaultLogger(OutputStream outputStream, boolean closeStreamsAfterUse) {
}

/**
* Creates a new <code>DefaultLogger</code> instance.
* Creates a new {@code DefaultLogger} instance.
* @param infoStream the {@code OutputStream} for info messages.
* @param closeInfoAfterUse auditFinished should close infoStream.
* @param errorStream the {@code OutputStream} for error messages.
Expand Down
Expand Up @@ -30,6 +30,7 @@
*
* @author Oliver Burn
* @author <a href="mailto:dobratzp@ele.uri.edu">Peter Dobratz</a>
* @noinspection HtmlTagCanBeJavadocTag
*/
public final class TokenTypes {
// The following three types are never part of an AST,
Expand Down
Expand Up @@ -34,7 +34,7 @@
* <p>
* Restrict using <a href =
* "http://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.3">
* Unicode escapes</a> (such as <code>&#92;u221e</code>).
* Unicode escapes</a> (such as {@code &#92;u221e}).
* It is possible to allow using escapes for
* <a href="https://en.wiktionary.org/wiki/Appendix:Control_characters">
* non-printable(control) characters</a>.
Expand Down
Expand Up @@ -31,7 +31,7 @@
* Checks that any combination of String literals
* is on the left side of an equals() comparison.
* Also checks for String literals assigned to some field
* (such as <code>someString.equals(anotherString = "text")</code>).
* (such as {@code someString.equals(anotherString = "text")}).
*
* <p>Rationale: Calling the equals() method on String literals
* will avoid a potential NullPointerException. Also, it is
Expand Down
Expand Up @@ -33,7 +33,7 @@
* <p>
* Checks that class which has only private ctors
* is declared as final. Doesn't check for classes nested in interfaces
* or annotations, as they are always <code>final</code> there.
* or annotations, as they are always {@code final} there.
* </p>
* <p>
* An example of how to configure the check is:
Expand Down
Expand Up @@ -81,13 +81,13 @@ protected IndentLevel getIndentImpl() {
* Checks if ast2 is a chained method call that starts on the same level as ast1 ends.
* In other words, if the right paren of ast1 is on the same level as the lparen of ast2:
*
* <code>
* {@code
* value.methodOne(
* argument1
* ).methodTwo(
* argument2
* );
* </code>
* }
*
* @param ast1 Ast1
* @param ast2 Ast2
Expand Down
Expand Up @@ -30,7 +30,7 @@
import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;

/**
* Checks that a variable has Javadoc comment. Ignores <code>serialVersionUID</code> fields.
* Checks that a variable has Javadoc comment. Ignores {@code serialVersionUID} fields.
*
* @author Oliver Burn
*/
Expand Down
Expand Up @@ -29,19 +29,19 @@

/**
* Checks for redundant modifiers in interface and annotation definitions,
* final modifier on methods of final classes, inner <code>interface</code>
* declarations that are declared as <code>static</code>, non public class
* final modifier on methods of final classes, inner {@code interface}
* declarations that are declared as {@code static}, non public class
* constructors and enum constructors, nested enum definitions that are declared
* as <code>static</code>.
* as {@code static}.
*
* <p>Interfaces by definition are abstract so the <code>abstract</code>
* <p>Interfaces by definition are abstract so the {@code abstract}
* modifier on the interface is redundant.
*
* <p>Classes inside of interfaces by definition are public and static,
* so the <code>public</code> and <code>static</code> modifiers
* so the {@code public} and {@code static} modifiers
* on the inner classes are redundant. On the other hand, classes
* inside of interfaces can be abstract or non abstract.
* So, <code>abstract</code> modifier is allowed.
* So, {@code abstract} modifier is allowed.
*
* <p>Fields in interfaces and annotations are automatically
* public, static and final, so these modifiers are redundant as
Expand All @@ -52,8 +52,8 @@
* annotation fields are automatically public and abstract.</p>
*
* <p>Enums by definition are static implicit subclasses of java.lang.Enum&#60;E&#62;.
* So, the <code>static</code> modifier on the enums is redundant. In addition,
* if enum is inside of interface, <code>public</code> modifier is also redundant.</p>
* So, the {@code static} modifier on the enums is redundant. In addition,
* if enum is inside of interface, {@code public} modifier is also redundant.</p>
*
* <p>Enums can also contain abstract methods and methods which can be overridden by the declared
* enumeration fields.
Expand All @@ -74,7 +74,7 @@
* <p>Since these methods can be overridden in these situations, the final methods are not
* marked as redundant even though they can't be extended by other classes/enums.</p>
*
* <p>Final classes by definition cannot be extended so the <code>final</code>
* <p>Final classes by definition cannot be extended so the {@code final}
* modifier on the method of a final class is redundant.
*
* <p>Public modifier for constructors in non-public non-protected classes
Expand Down
Expand Up @@ -29,7 +29,7 @@

/**
* <p>
* Checks that method and <code>catch</code> parameter names conform to a format specified
* Checks that method and {@code catch} parameter names conform to a format specified
* by the format property. The format is a
* {@link java.util.regex.Pattern regular expression}
* and defaults to
Expand Down
Expand Up @@ -519,7 +519,7 @@ private boolean hasEmptyLineAfter(DetailAST token) {
* started from 1 for parameter values
* @param startLine number of the first line in the range
* @param endLine number of the second line in the range
* @return <code>true</code> if found any blank line within the range, <code>false</code>
* @return {@code true} if found any blank line within the range, {@code false}
* otherwise
*/
private boolean hasEmptyLine(int startLine, int endLine) {
Expand Down
Expand Up @@ -26,7 +26,7 @@

/**
* <p>
* File filter <code>BeforeExecutionExclusionFileFilter</code> decides which files should be
* File filter {@code BeforeExecutionExclusionFileFilter} decides which files should be
* excluded from being processed by the utility.
* </p>
*
Expand All @@ -35,8 +35,8 @@
* checked for violations. Users could have files that are in these sub-directories that shouldn't
* be processed with their checkstyle configuration for various reasons, one of which is a valid
* Java file that won't pass Checkstyle's parser. When Checkstyle tries to parse a Java file and
* fails, it will throw an <code>Exception</code> and halt parsing any more files for violations.
* An example of a valid Java file Checkstyle can't parse is JDK 9's <code>module-info.java</code>.
* fails, it will throw an {@code Exception} and halt parsing any more files for violations.
* An example of a valid Java file Checkstyle can't parse is JDK 9's {@code module-info.java}.
* This file filter will exclude these problem files from being parsed, allowing the rest of the
* files to run normal and be validated.
* </p>
Expand Down
Expand Up @@ -219,15 +219,15 @@ public boolean isLeaf(Object node) {
}

/**
* Return the index of child in parent. If either <code>parent</code>
* or <code>child</code> is <code>null</code>, returns -1.
* If either <code>parent</code> or <code>child</code> don't
* Return the index of child in parent. If either {@code parent}
* or {@code child} is {@code null}, returns -1.
* If either {@code parent} or {@code child} don't
* belong to this tree model, returns -1.
*
* @param parent a node in the tree, obtained from this data source.
* @param child the node we are interested in.
* @return the index of the child in the parent, or -1 if either
* <code>child</code> or <code>parent</code> are <code>null</code>
* {@code child} or {@code parent} are {@code null}
* or don't belong to this tree model.
*/
public int getIndexOfChild(Object parent, Object child) {
Expand Down

0 comments on commit 256e6a7

Please sign in to comment.