Skip to content

Commit

Permalink
Fix typos in code and Javadoc. #1555
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, and fix them in one click.
  • Loading branch information
mkordas authored and romani committed Aug 25, 2015
1 parent 8f86620 commit d345f3b
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public Integer[] getLinesWithWarn(String aFileName) throws IOException {
private static final Pattern MULTILEVEL_COMMENT_REGEX =
Pattern.compile("//indent:\\d+ exp:(\\d+(,\\d+)+?)( warn)?");

private static final Pattern SINGLELEVEL_COMMENT_REGEX =
private static final Pattern SINGLE_LEVEL_COMMENT_REGEX =
Pattern.compile("//indent:\\d+ exp:(\\d+)( warn)?");

private static final Pattern NONSTRICT_LEVEL_COMMENT_REGEX =
private static final Pattern NON_STRICT_LEVEL_COMMENT_REGEX =
Pattern.compile("//indent:\\d+ exp:>=(\\d+)( warn)?");

protected static Integer[] getLinesWithWarnAndCheckComments(String aFileName,
Expand Down Expand Up @@ -123,15 +123,15 @@ private static boolean isCommentConsistent(String comment)
|| !containsActualLevel && isWarnComment;
}

match = SINGLELEVEL_COMMENT_REGEX.matcher(comment);
match = SINGLE_LEVEL_COMMENT_REGEX.matcher(comment);
if (match.matches()) {
final int expectedLevel = Integer.parseInt(match.group(1));

return expectedLevel == indentInComment && !isWarnComment
|| expectedLevel != indentInComment && isWarnComment;
}

match = NONSTRICT_LEVEL_COMMENT_REGEX.matcher(comment);
match = NON_STRICT_LEVEL_COMMENT_REGEX.matcher(comment);
if (match.matches()) {
final int expectedMinimalIndent = Integer.parseInt(match.group(1));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void setMaxErrors(int maxErrors) {
}

/**
* Sets the maximum number of warings allowed. Default is
* Sets the maximum number of warnings allowed. Default is
* {@link Integer#MAX_VALUE}.
* @param maxWarnings the maximum number of warnings allowed.
*/
Expand All @@ -142,7 +142,7 @@ public void setMaxWarnings(int maxWarnings) {
}

/**
* Adds uset of files (nested fileset attribute).
* Adds set of files (nested fileset attribute).
* @param fS the file set to add
*/
public void addFileset(FileSet fS) {
Expand All @@ -167,7 +167,7 @@ public void addProperty(Property property) {

/**
* Set the class path.
* @param classpath the path to locate cluses
* @param classpath the path to locate classes
*/
public void setClasspath(Path classpath) {
if (this.classpath == null) {
Expand All @@ -186,7 +186,7 @@ public void setClasspathRef(Reference classpathRef) {
createClasspath().setRefid(classpathRef);
}

/** @return a created path for locating cluses */
/** @return a created path for locating classes */
public Path createClasspath() {
if (classpath == null) {
classpath = new Path(getProject());
Expand Down Expand Up @@ -606,17 +606,17 @@ public void setFile(File file) {

/** Represents a custom listener. */
public static class Listener {
/** Classname of the listener class */
private String classname;
/** Class name of the listener class */
private String className;

/** @return the classname */
/** @return the class name */
public String getClassname() {
return classname;
return className;
}

/** @param classname set the classname */
public void setClassname(String classname) {
this.classname = classname;
/** @param name set the class name */
public void setClassname(String name) {
className = name;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class EmptyForInitializerPadCheck
public static final String MSG_NOT_PRECEDED = "ws.notPreceded";

/**
* Sets the paren pad otion to nospace.
* Sets the paren pad option to nospace.
*/
public EmptyForInitializerPadCheck() {
super(PadOption.NOSPACE, PadOption.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class EmptyForIteratorPadCheck
public static final String WS_NOT_FOLLOWED = "ws.notFollowed";

/**
* Sets the paren pad otion to nospace.
* Sets the paren pad option to nospace.
*/
public EmptyForIteratorPadCheck() {
super(PadOption.NOSPACE, PadOption.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
* <p>
* Checks that there is no whitespace after a token.
* More specifically, it checks that it is not followed by whitespace,
* or (if linebreaks are allowed) all characters on the line after are
* whitespace. To forbid linebreaks afer a token, set property
* or (if line breaks are allowed) all characters on the line after are
* whitespace. To forbid line breaks after a token, set property
* allowLineBreaks to false.
* </p>
* <p> By default the check will check the following operators:
Expand All @@ -51,7 +51,7 @@
* <pre>
* &lt;module name="NoWhitespaceAfter"/&gt;
* </pre>
* <p> An example of how to configure the check to forbid linebreaks after
* <p> An example of how to configure the check to forbid line breaks after
* a {@link TokenTypes#DOT DOT} token is:
* </p>
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected AbstractTreeTableModel(Object root) {
}

//
// Default implmentations for methods in the TreeModel interface.
// Default implementations for methods in the TreeModel interface.
//

@Override
Expand Down Expand Up @@ -198,7 +198,7 @@ protected void fireTreeStructureChanged(Object source, Object[] path,
}

//
// Default impelmentations for methods in the TreeTableModel interface.
// Default implementations for methods in the TreeTableModel interface.
//

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void updateSelectedPathIfRowIsSelected(int counter) {

/**
* Class responsible for calling updateSelectedPathsFromSelectedRows
* when the selection of the list changse.
* when the selection of the list changes.
*/
class ListSelectionHandler implements ListSelectionListener {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testMakeCheckFromName()
}

@Test
public void testMakeObectFromList()
public void testMakeObjectFromList()
throws CheckstyleException {
factory.addPackage("com.");
final Checker checker =
Expand All @@ -73,10 +73,10 @@ public void testMakeObectFromList()
}

@Test
public void testMakeObectNoClass() {
public void testMakeObjectNoClass() {
try {
factory.createModule("NoClass");
fail("Instantiated non-existant class");
fail("Instantiated non-existent class");
}
catch (CheckstyleException ex) {
assertEquals("CheckstyleException.message",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.puppycrawl.tools.checkstyle.api.TokenTypes;

/**
* Testcase for the JavaNCSS-Check.
* Test case for the JavaNCSS-Check.
*
* @author Lars Ködderitzsch
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AbbreviationAsWordInNameCheckTest extends BaseCheckTestSupport {
private String warningMessage;

@Test
public void testTypeNamesForThreePermitedCapitalLetters() throws Exception {
public void testTypeNamesForThreePermittedCapitalLetters() throws Exception {

final DefaultConfiguration checkConfig = createCheckConfig(AbbreviationAsWordInNameCheck.class);
final int expectedCapitalCount = 3;
Expand All @@ -54,7 +54,7 @@ public void testTypeNamesForThreePermitedCapitalLetters() throws Exception {
}

@Test
public void testTypeNamesForFourPermitedCapitalLetters() throws Exception {
public void testTypeNamesForFourPermittedCapitalLetters() throws Exception {

final int expectedCapitalCount = 4;
warningMessage = getCheckMessage(MSG_KEY, expectedCapitalCount);
Expand All @@ -72,7 +72,7 @@ public void testTypeNamesForFourPermitedCapitalLetters() throws Exception {
}

@Test
public void testTypeNamesForFivePermitedCapitalLetters() throws Exception {
public void testTypeNamesForFivePermittedCapitalLetters() throws Exception {

final int expectedCapitalCount = 5;
warningMessage = getCheckMessage(MSG_KEY, expectedCapitalCount);
Expand Down Expand Up @@ -225,7 +225,7 @@ public void testTypeAndVariablesAndMethodNamesWithIgnoresStatic() throws Excepti
}

@Test
public void testTypeNamesForThreePermitedCapitalLettersWithOverridenMethod() throws Exception {
public void testTypeNamesForThreePermittedCapitalLettersWithOverridenMethod() throws Exception {

final DefaultConfiguration checkConfig = createCheckConfig(AbbreviationAsWordInNameCheck.class);
final int expectedCapitalCount = 3;
Expand All @@ -244,7 +244,7 @@ public void testTypeNamesForThreePermitedCapitalLettersWithOverridenMethod() thr
}

@Test
public void testTypeNamesForZeroPermitedCapitalLetter() throws Exception {
public void testTypeNamesForZeroPermittedCapitalLetter() throws Exception {
final DefaultConfiguration checkConfig =
createCheckConfig(AbbreviationAsWordInNameCheck.class);
final int expectedCapitalCount = 0;
Expand Down

0 comments on commit d345f3b

Please sign in to comment.