Issue #1555: Fix various typos
Fixes some `SpellCheckingInspection` inspection violations. Description: >Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
This commit is contained in:
parent
46a52f84c0
commit
07b24dd81c
|
|
@ -264,11 +264,11 @@ public class AnnotationLocationCheck extends Check {
|
|||
* @return Some javadoc.
|
||||
*/
|
||||
private static String getAnnotationName(DetailAST annotation) {
|
||||
DetailAST idenNode = annotation.findFirstToken(TokenTypes.IDENT);
|
||||
if (idenNode == null) {
|
||||
idenNode = annotation.findFirstToken(TokenTypes.DOT).findFirstToken(TokenTypes.IDENT);
|
||||
DetailAST identNode = annotation.findFirstToken(TokenTypes.IDENT);
|
||||
if (identNode == null) {
|
||||
identNode = annotation.findFirstToken(TokenTypes.DOT).findFirstToken(TokenTypes.IDENT);
|
||||
}
|
||||
return idenNode.getText();
|
||||
return identNode.getText();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
* <p>
|
||||
* Using the COMPACT style is less verbose. This style can only
|
||||
* be used when there is an element called 'value' which is either
|
||||
* the sole element or all other elements have default valuess.
|
||||
* the sole element or all other elements have default values.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
|
|
@ -83,7 +83,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
*
|
||||
* <p>
|
||||
* By default the ElementStyle is set to EXPANDED, the TrailingArrayComma
|
||||
* is set to NEVER, and the ClosingParans is set to ALWAYS.
|
||||
* is set to NEVER, and the ClosingParens is set to ALWAYS.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
|
|
@ -208,14 +208,14 @@ public final class AnnotationUseStyleCheck extends Check {
|
|||
/**
|
||||
* Retrieves an {@link Enum Enum} type from a @{link String String}.
|
||||
* @param <T> the enum type
|
||||
* @param enuclass the enum class
|
||||
* @param enumClass the enum class
|
||||
* @param value the string representing the enum
|
||||
* @return the enum type
|
||||
*/
|
||||
private static <T extends Enum<T>> T getOption(final Class<T> enuclass,
|
||||
private static <T extends Enum<T>> T getOption(final Class<T> enumClass,
|
||||
final String value) {
|
||||
try {
|
||||
return Enum.valueOf(enuclass, value.trim().toUpperCase(Locale.ENGLISH));
|
||||
return Enum.valueOf(enumClass, value.trim().toUpperCase(Locale.ENGLISH));
|
||||
}
|
||||
catch (final IllegalArgumentException iae) {
|
||||
throw new ConversionException("unable to parse " + value, iae);
|
||||
|
|
|
|||
|
|
@ -178,20 +178,19 @@ public final class MissingDeprecatedCheck extends Check {
|
|||
currentLine++;
|
||||
final String line = lines[i];
|
||||
|
||||
final Matcher javadocNoargMatcher =
|
||||
final Matcher javadocNoArgMatcher =
|
||||
MATCH_DEPRECATED.matcher(line);
|
||||
final Matcher noargMultilineStart = MATCH_DEPRECATED_MULTILINE_START.matcher(line);
|
||||
final Matcher noArgMultilineStart = MATCH_DEPRECATED_MULTILINE_START.matcher(line);
|
||||
|
||||
if (javadocNoargMatcher.find()) {
|
||||
if (javadocNoArgMatcher.find()) {
|
||||
if (found) {
|
||||
log(currentLine, MSG_KEY_JAVADOC_DUPLICATE_TAG,
|
||||
JavadocTagInfo.DEPRECATED.getText());
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
else if (noargMultilineStart.find()) {
|
||||
else if (noArgMultilineStart.find()) {
|
||||
found = checkTagAtTheRestOfComment(lines, found, currentLine, i);
|
||||
|
||||
}
|
||||
}
|
||||
return found;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public final class MissingOverrideCheck extends Check {
|
|||
private static final String FQ_OVERRIDE = "java.lang." + OVERRIDE;
|
||||
|
||||
/** Compiled regexp to match Javadoc tags with no argument and {} * */
|
||||
private static final Pattern MATCH_INHERITDOC =
|
||||
private static final Pattern MATCH_INHERIT_DOC =
|
||||
CommonUtils.createPattern("\\{\\s*@(inheritDoc)\\s*\\}");
|
||||
|
||||
/** @see #setJavaFiveCompatibility(boolean) */
|
||||
|
|
@ -143,8 +143,8 @@ public final class MissingOverrideCheck extends Check {
|
|||
final TextBlock javadoc =
|
||||
getFileContents().getJavadocBefore(ast.getLineNo());
|
||||
|
||||
final boolean containastag = containsJavadocTag(javadoc);
|
||||
if (containastag && !JavadocTagInfo.INHERIT_DOC.isValidOn(ast)) {
|
||||
final boolean containsTag = containsJavadocTag(javadoc);
|
||||
if (containsTag && !JavadocTagInfo.INHERIT_DOC.isValidOn(ast)) {
|
||||
log(ast.getLineNo(), MSG_KEY_TAG_NOT_VALID_ON,
|
||||
JavadocTagInfo.INHERIT_DOC.getText());
|
||||
return;
|
||||
|
|
@ -160,7 +160,7 @@ public final class MissingOverrideCheck extends Check {
|
|||
}
|
||||
}
|
||||
|
||||
if (containastag
|
||||
if (containsTag
|
||||
&& !AnnotationUtility.containsAnnotation(ast, OVERRIDE)
|
||||
&& !AnnotationUtility.containsAnnotation(ast, FQ_OVERRIDE)) {
|
||||
log(ast.getLineNo(), MSG_KEY_ANNOTATION_MISSING_OVERRIDE);
|
||||
|
|
@ -181,7 +181,7 @@ public final class MissingOverrideCheck extends Check {
|
|||
|
||||
for (final String line : lines) {
|
||||
final Matcher matchInheritDoc =
|
||||
MATCH_INHERITDOC.matcher(line);
|
||||
MATCH_INHERIT_DOC.matcher(line);
|
||||
|
||||
if (matchInheritDoc.find()) {
|
||||
javadocTag = true;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class RedundantModifierCheck
|
|||
checkEnumConstructorModifiers(ast);
|
||||
}
|
||||
else {
|
||||
checkClassContructorModifiers(ast);
|
||||
checkClassConstructorModifiers(ast);
|
||||
}
|
||||
}
|
||||
else if (isInterfaceOrAnnotationMember(ast)) {
|
||||
|
|
@ -235,7 +235,7 @@ public class RedundantModifierCheck
|
|||
* Check if class constructor has proper modifiers
|
||||
* @param classCtorAst class constructor ast
|
||||
*/
|
||||
private void checkClassContructorModifiers(DetailAST classCtorAst) {
|
||||
private void checkClassConstructorModifiers(DetailAST classCtorAst) {
|
||||
final DetailAST classDef = classCtorAst.getParent().getParent();
|
||||
if (!isClassPublic(classDef) && !isClassProtected(classDef)) {
|
||||
checkForRedundantPublicModifier(classCtorAst);
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
* <p>
|
||||
* Checks that there is no whitespace before a token.
|
||||
* More specifically, it checks that it is not preceded with whitespace,
|
||||
* or (if linebreaks are allowed) all characters on the line before are
|
||||
* whitespace. To allow linebreaks before a token, set property
|
||||
* or (if line breaks are allowed) all characters on the line before are
|
||||
* whitespace. To allow line breaks before a token, set property
|
||||
* allowLineBreaks to true.
|
||||
* </p>
|
||||
* <p> By default the check will check the following operators:
|
||||
|
|
@ -47,7 +47,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
* <pre>
|
||||
* <module name="NoWhitespaceBefore"/>
|
||||
* </pre>
|
||||
* <p> An example of how to configure the check to allow linebreaks before
|
||||
* <p> An example of how to configure the check to allow line breaks before
|
||||
* a {@link TokenTypes#DOT DOT} token is:
|
||||
* </p>
|
||||
* <pre>
|
||||
|
|
@ -128,7 +128,7 @@ public class NoWhitespaceBeforeCheck
|
|||
/**
|
||||
* Control whether whitespace is flagged at linebreaks.
|
||||
* @param allowLineBreaks whether whitespace should be
|
||||
* flagged at linebreaks.
|
||||
* flagged at line breaks.
|
||||
*/
|
||||
public void setAllowLineBreaks(boolean allowLineBreaks) {
|
||||
this.allowLineBreaks = allowLineBreaks;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class AnnotationUseStyleTest extends BaseCheckTestSupport {
|
|||
* Test that annotation parens are always present.
|
||||
*/
|
||||
@Test
|
||||
public void testParansAlways() throws Exception {
|
||||
public void testParensAlways() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(AnnotationUseStyleCheck.class);
|
||||
checkConfig.addAttribute("closingParens", "ALWAYS");
|
||||
checkConfig.addAttribute("elementStyle", "ignore");
|
||||
|
|
@ -95,7 +95,7 @@ public class AnnotationUseStyleTest extends BaseCheckTestSupport {
|
|||
* Test that annotation parens are never present.
|
||||
*/
|
||||
@Test
|
||||
public void testParansNever() throws Exception {
|
||||
public void testParensNever() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(AnnotationUseStyleCheck.class);
|
||||
checkConfig.addAttribute("closingParens", "NEVER");
|
||||
checkConfig.addAttribute("elementStyle", "ignore");
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class MissingDeprecatedTest extends BaseCheckTestSupport {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that memebers that are only deprecated via javadoc are flagged.
|
||||
* Tests that members that are only deprecated via javadoc are flagged.
|
||||
*/
|
||||
@Test
|
||||
public void testBadDeprecatedAnnotation() throws Exception {
|
||||
|
|
@ -75,7 +75,7 @@ public class MissingDeprecatedTest extends BaseCheckTestSupport {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests that memebers that are only deprecated via the annotation are flagged.
|
||||
* Tests that members that are only deprecated via the annotation are flagged.
|
||||
*/
|
||||
@Test
|
||||
public void testBadDeprecatedJavadoc() throws Exception {
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testGetAcceptableTockens() throws Exception {
|
||||
public void testGetAcceptableTokens() throws Exception {
|
||||
int[] expectedTokens = {TokenTypes.METHOD_DEF };
|
||||
MissingOverrideCheck check = new MissingOverrideCheck();
|
||||
int[] actual = check.getAcceptableTokens();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class PackageAnnotationTest extends BaseCheckTestSupport {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testAnnotationnotInPackageInfo() throws Exception {
|
||||
public void testAnnotationNotInPackageInfo() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(PackageAnnotationCheck.class);
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
|
|
|||
Loading…
Reference in New Issue