Skip to content

Commit

Permalink
Fix typos in Indentation check code. #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 c4a7d06 commit c2ce485
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
Expand Up @@ -207,9 +207,9 @@ static boolean areOnSameLine(DetailAST ast1, DetailAST ast2) {
}

/**
* Searchs in given sub-tree (including given node) for the token
* Searches in given sub-tree (including given node) for the token
* which represents first symbol for this sub-tree in file.
* @param ast a root of sub-tree in which the search shoul be performed.
* @param ast a root of sub-tree in which the search should be performed.
* @return a token which occurs first in the file.
*/
static DetailAST getFirstToken(DetailAST ast) {
Expand Down Expand Up @@ -275,7 +275,7 @@ protected boolean shouldIncreaseIndent() {
* @param lines the set of lines to check
* @param indentLevel the indentation level
* @param firstLineMatches whether or not the first line has to match
* @param firstLine firstline of whole expression
* @param firstLine first line of whole expression
*/
private void checkLinesIndent(LineSet lines,
IndentLevel indentLevel,
Expand Down
Expand Up @@ -30,10 +30,10 @@
public class ArrayInitHandler extends BlockParentHandler {
/**
* Construct an instance of this handler with the given indentation check,
* astract syntax tree, and parent handler.
* abstract syntax tree, and parent handler.
*
* @param indentCheck the indentation check
* @param ast the astract syntax tree
* @param ast the abstract syntax tree
* @param parent the parent handler
*/
public ArrayInitHandler(IndentationCheck indentCheck,
Expand Down Expand Up @@ -101,7 +101,7 @@ protected IndentLevel getChildrenExpectedLevel() {
final int firstLine = getFirstLine(Integer.MAX_VALUE, getListChild());
final int lcurlyPos = expandedTabsColumnNo(getLCurly());
final int firstChildPos =
getNextFirstNonblankOnLineAfter(firstLine, lcurlyPos);
getNextFirstNonBlankOnLineAfter(firstLine, lcurlyPos);
if (firstChildPos >= 0) {
expectedIndent.addAcceptedIndent(firstChildPos);
expectedIndent.addAcceptedIndent(lcurlyPos + getLineWrappingIndentation());
Expand All @@ -117,7 +117,7 @@ protected IndentLevel getChildrenExpectedLevel() {
* specified column on specified line or -1 if
* such char doesn't exist.
*/
private int getNextFirstNonblankOnLineAfter(int lineNo, int columnNo) {
private int getNextFirstNonBlankOnLineAfter(int lineNo, int columnNo) {
int realColumnNo = columnNo + 1;
final String line = getIndentCheck().getLines()[lineNo - 1];
final int lineLength = line.length();
Expand Down
Expand Up @@ -34,7 +34,7 @@
* <LI>template method to get the rcurly</LI>
* <LI>if curlys aren't present, then template method to get expressions
* is called</LI>
* <LI>now all the repetitous code which checks for BOL, if curlys are on
* <LI>now all the repetitious code which checks for BOL, if curlys are on
* same line, etc. can be collapsed into the superclass</LI>
* </UL>
*
Expand Down Expand Up @@ -70,7 +70,7 @@ public BlockParentHandler(IndentationCheck indentCheck,
}

/**
* Returns array of token types which should be checked among childrens.
* Returns array of token types which should be checked among children.
* @return array of token types to check.
*/
protected int[] getCheckedChildren() {
Expand Down Expand Up @@ -244,7 +244,7 @@ protected DetailAST getListChild() {
/**
* Get the right parenthesis portion of the expression we are handling.
*
* @return the right parenthis expression
* @return the right parenthesis expression
*/
protected DetailAST getRParen() {
return getMainAst().findFirstToken(TokenTypes.RPAREN);
Expand All @@ -253,7 +253,7 @@ protected DetailAST getRParen() {
/**
* Get the left parenthesis portion of the expression we are handling.
*
* @return the left parenthis expression
* @return the left parenthesis expression
*/
protected DetailAST getLParen() {
return getMainAst().findFirstToken(TokenTypes.LPAREN);
Expand All @@ -262,7 +262,7 @@ protected DetailAST getLParen() {
@Override
public void checkIndentation() {
checkToplevelToken();
// seperate to allow for eventual configuration
// separate to allow for eventual configuration
checkLParen(getLParen());
checkRParen(getLParen(), getRParen());
if (hasCurlys()) {
Expand Down
Expand Up @@ -168,7 +168,7 @@ private static DetailAST getPrevStatementFromSwitchBlock(DetailAST comment) {
}

/**
* Gets previous statement for comment which is placed immediatly under case.
* Gets previous statement for comment which is placed immediately under case.
* @param parentStatement comment's parent statement.
* @return comment's previous statement or null if previous statement is absent.
*/
Expand Down
Expand Up @@ -29,10 +29,10 @@
public class FinallyHandler extends BlockParentHandler {
/**
* Construct an instance of this handler with the given indentation check,
* astract syntax tree, and parent handler.
* abstract syntax tree, and parent handler.
*
* @param indentCheck the indentation check
* @param ast the astract syntax tree
* @param ast the abstract syntax tree
* @param parent the parent handler
*/
public FinallyHandler(IndentationCheck indentCheck,
Expand Down
Expand Up @@ -23,7 +23,7 @@

/**
* Encapsulates representation of notion of expected indentation levels.
* Provide a way to have multiple accaptable levels.
* Provide a way to have multiple acceptable levels.
*
* @author o_sukhodolsky
*/
Expand All @@ -32,8 +32,8 @@ public class IndentLevel {
private final BitSet levels = new BitSet();

/**
* Creates new instance with one accaptable indentation level.
* @param indent accaptable indentation level.
* Creates new instance with one acceptable indentation level.
* @param indent acceptable indentation level.
*/
public IndentLevel(int indent) {
levels.set(indent);
Expand All @@ -54,8 +54,8 @@ public IndentLevel(IndentLevel base, int... offsets) {
}

/**
* Checks wether we have more than one level.
* @return wether we have more than one level.
* Checks whether we have more than one level.
* @return whether we have more than one level.
*/
public final boolean isMultiLevel() {
return levels.cardinality() > 1;
Expand Down
Expand Up @@ -61,7 +61,7 @@ public void checkIndentation() {
}

/**
* Check identation of expression we synchronized on
* Check indentation of expression we synchronized on
*/
private void checkSynchronizedExpr() {
final DetailAST syncAst = getMainAst().findFirstToken(TokenTypes.LPAREN)
Expand Down
Expand Up @@ -324,7 +324,7 @@ public void testAnonClassesFromGuava() throws Exception {
}

@Test
public void testAnnotatins() throws Exception {
public void testAnnotations() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);

checkConfig.addAttribute("arrayInitIndent", "4");
Expand Down Expand Up @@ -388,7 +388,7 @@ public void testArrays() throws Exception {
}

@Test
public void testLables() throws Exception {
public void testLabels() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class);

checkConfig.addAttribute("arrayInitIndent", "4");
Expand Down

0 comments on commit c2ce485

Please sign in to comment.