Skip to content

Commit

Permalink
Issue #2080: Fix typos in code
Browse files Browse the repository at this point in the history
Fixes some `SpellCheckingInspection` inspection violations.

Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
  • Loading branch information
mkordas authored and romani committed Sep 5, 2015
1 parent e7547bb commit d220d7c
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 84 deletions.
Expand Up @@ -4,7 +4,7 @@
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;


class InputOneCharInintVarName class InputOneCharInitVarName
{ {
public void fooMethod() public void fooMethod()
{ {
Expand Down
Expand Up @@ -192,7 +192,7 @@ public class ImportOrderCheck
/** The special wildcard that catches all remaining groups. */ /** The special wildcard that catches all remaining groups. */
private static final String WILDCARD_GROUP_NAME = "*"; private static final String WILDCARD_GROUP_NAME = "*";


/** Empty array of pattern type needed to initlialize check. */ /** Empty array of pattern type needed to initialize check. */
private static final Pattern[] EMPTY_PATTERN_ARRAY = new Pattern[0]; private static final Pattern[] EMPTY_PATTERN_ARRAY = new Pattern[0];


/** List of import groups specified by the user. */ /** List of import groups specified by the user. */
Expand Down
Expand Up @@ -56,9 +56,9 @@ private void checkForParams() {
getMainAst().findFirstToken(TokenTypes.FOR_CONDITION); getMainAst().findFirstToken(TokenTypes.FOR_CONDITION);
checkExpressionSubtree(cond, expected, false, false); checkExpressionSubtree(cond, expected, false, false);


final DetailAST iter = final DetailAST forIterator =
getMainAst().findFirstToken(TokenTypes.FOR_ITERATOR); getMainAst().findFirstToken(TokenTypes.FOR_ITERATOR);
checkExpressionSubtree(iter, expected, false, false); checkExpressionSubtree(forIterator, expected, false, false);
} }
// for each // for each
else { else {
Expand Down
Expand Up @@ -30,7 +30,7 @@
* *
* <p> * <p>
* The basic idea behind this is that while * The basic idea behind this is that while
* pretty printers are sometimes convenient for. reformats of * pretty printers are sometimes convenient for reformats of
* legacy code, they often either aren't configurable enough or * legacy code, they often either aren't configurable enough or
* just can't anticipate how format should be done. Sometimes this is * just can't anticipate how format should be done. Sometimes this is
* personal preference, other times it is practical experience. In any * personal preference, other times it is practical experience. In any
Expand Down
Expand Up @@ -85,7 +85,7 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck {
* A key is pointing to the warning message text in "messages.properties" * A key is pointing to the warning message text in "messages.properties"
* file. * file.
*/ */
public static final String MSG_EXCPECTED_TAG = "javadoc.expectedTag"; public static final String MSG_EXPECTED_TAG = "javadoc.expectedTag";


/** /**
* A key is pointing to the warning message text in "messages.properties" * A key is pointing to the warning message text in "messages.properties"
Expand Down Expand Up @@ -766,12 +766,12 @@ private void checkParamTags(final List<JavadocTag> tags,
// the user has chosen to suppress these problems // the user has chosen to suppress these problems
if (!allowMissingParamTags && reportExpectedTags) { if (!allowMissingParamTags && reportExpectedTags) {
for (DetailAST param : params) { for (DetailAST param : params) {
log(param, MSG_EXCPECTED_TAG, log(param, MSG_EXPECTED_TAG,
JavadocTagInfo.PARAM.getText(), param.getText()); JavadocTagInfo.PARAM.getText(), param.getText());
} }


for (DetailAST typeParam : typeParams) { for (DetailAST typeParam : typeParams) {
log(typeParam, MSG_EXCPECTED_TAG, log(typeParam, MSG_EXPECTED_TAG,
JavadocTagInfo.PARAM.getText(), JavadocTagInfo.PARAM.getText(),
"<" + typeParam.findFirstToken(TokenTypes.IDENT).getText() "<" + typeParam.findFirstToken(TokenTypes.IDENT).getText()
+ ">"); + ">");
Expand Down Expand Up @@ -912,7 +912,7 @@ private void checkThrowsTags(List<JavadocTag> tags,
if (!ei.isFound()) { if (!ei.isFound()) {
final Token fi = ei.getName(); final Token fi = ei.getName();
log(fi.getLineNo(), fi.getColumnNo(), log(fi.getLineNo(), fi.getColumnNo(),
MSG_EXCPECTED_TAG, MSG_EXPECTED_TAG,
JavadocTagInfo.THROWS.getText(), fi.getText()); JavadocTagInfo.THROWS.getText(), fi.getText());
} }
} }
Expand Down Expand Up @@ -976,7 +976,7 @@ private static class ExceptionInfo {
/** /**
* Creates new instance for {@code FullIdent}. * Creates new instance for {@code FullIdent}.
* *
* @param classInfo clas info * @param classInfo class info
*/ */
ExceptionInfo(AbstractClassInfo classInfo) { ExceptionInfo(AbstractClassInfo classInfo) {
this.classInfo = classInfo; this.classInfo = classInfo;
Expand Down
Expand Up @@ -18,7 +18,7 @@
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////


/** /**
* Contains the doclets used during the build of Checktyle. REally * Contains the doclets used during the build of Checkstyle.
* <p> * <p>
* You should <strong>not be</strong> referring to this package. * You should <strong>not be</strong> referring to this package.
* </p> * </p>
Expand Down
Expand Up @@ -111,7 +111,7 @@ public void testBadOverrideFromOtherJ5Compat() throws Exception {
* for only including the inheritDoc tag. * for only including the inheritDoc tag.
*/ */
@Test @Test
public void testBadAnnonOverride() throws Exception { public void testBadAnnotationOverride() throws Exception {
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class); DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
final String[] expected = { final String[] expected = {
"10: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), "10: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE),
Expand All @@ -120,20 +120,20 @@ public void testBadAnnonOverride() throws Exception {
"35: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), "35: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE),
}; };


verify(checkConfig, getPath("annotation" + File.separator + "BadAnnonOverride.java"), expected); verify(checkConfig, getPath("annotation" + File.separator + "BadAnnotationOverride.java"), expected);
} }


/** /**
* This tests anonymous inner classes that are overriding methods are NOT flagged while in * This tests anonymous inner classes that are overriding methods are NOT flagged while in
* Java 5 compatibility mode. * Java 5 compatibility mode.
*/ */
@Test @Test
public void testBadAnnonOverrideJ5Compat() throws Exception { public void testBadAnnotationOverrideJ5Compat() throws Exception {
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class); DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
checkConfig.addAttribute("javaFiveCompatibility", "true"); checkConfig.addAttribute("javaFiveCompatibility", "true");
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;


verify(checkConfig, getPath("annotation" + File.separator + "BadAnnonOverride.java"), expected); verify(checkConfig, getPath("annotation" + File.separator + "BadAnnotationOverride.java"), expected);
} }


/** /**
Expand Down Expand Up @@ -209,24 +209,24 @@ public void testGoodOverrideFromOtherJ5Compat() throws Exception {
* for only including the inheritDoc tag. * for only including the inheritDoc tag.
*/ */
@Test @Test
public void testGoodAnnonOverride() throws Exception { public void testGoodAnnotationOverride() throws Exception {
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class); DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;


verify(checkConfig, getPath("annotation" + File.separator + "GoodAnnonOverride.java"), expected); verify(checkConfig, getPath("annotation" + File.separator + "GoodAnnotationOverride.java"), expected);
} }


/** /**
* This tests anonymous inner classes that are overriding methods are NOT flagged while in * This tests anonymous inner classes that are overriding methods are NOT flagged while in
* Java 5 compatibility mode. * Java 5 compatibility mode.
*/ */
@Test @Test
public void testGoodAnnonOverrideJ5Compat() throws Exception { public void testGoodAnnotationOverrideJ5Compat() throws Exception {
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class); DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
checkConfig.addAttribute("javaFiveCompatibility", "true"); checkConfig.addAttribute("javaFiveCompatibility", "true");
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY; final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;


verify(checkConfig, getPath("annotation" + File.separator + "GoodAnnonOverride.java"), expected); verify(checkConfig, getPath("annotation" + File.separator + "GoodAnnotationOverride.java"), expected);
} }


@Test @Test
Expand Down
Expand Up @@ -112,7 +112,7 @@ public void testUnknown() throws Exception {
fail("should fail"); fail("should fail");
} }
catch (CheckstyleException ex) { catch (CheckstyleException ex) {
//do nothng //do nothing
} }
} }


Expand Down
Expand Up @@ -44,7 +44,7 @@ public void testNumberFormatException() throws Exception {
+ "alternative at input '<ul><li>a' {@link EntityEntry} (by way of {@link #;' " + "alternative at input '<ul><li>a' {@link EntityEntry} (by way of {@link #;' "
+ "while parsing HTML_TAG"), + "while parsing HTML_TAG"),
}; };
verify(checkConfig, getPath("javadoc/InputTestNumberFomatException.java"), expected); verify(checkConfig, getPath("javadoc/InputTestNumberFormatException.java"), expected);
} }


@Test @Test
Expand Down
Expand Up @@ -48,10 +48,10 @@ public void setUp() {
@Test @Test
public void testIsSubclassWithNulls() throws Exception { public void testIsSubclassWithNulls() throws Exception {
JavadocMethodCheck check = new JavadocMethodCheck(); JavadocMethodCheck check = new JavadocMethodCheck();
Method isSublclass = check.getClass().getSuperclass() Method isSubclass = check.getClass().getSuperclass()
.getDeclaredMethod("isSubclass", Class.class, Class.class); .getDeclaredMethod("isSubclass", Class.class, Class.class);
isSublclass.setAccessible(true); isSubclass.setAccessible(true);
assertFalse((boolean) isSublclass.invoke(check, null, null)); assertFalse((boolean) isSubclass.invoke(check, null, null));
} }


@Test @Test
Expand Down

0 comments on commit d220d7c

Please sign in to comment.