Issue #2080: Fix typos in code
This commit is contained in:
parent
2cf54ade21
commit
d282053d9c
|
|
@ -244,7 +244,7 @@
|
|||
<rule ref="rulesets/java/strings.xml"/>
|
||||
<rule ref="rulesets/java/sunsecure.xml/MethodReturnsInternalArray">
|
||||
<properties>
|
||||
<!--It's not imoprtant when array is empty-->
|
||||
<!--It's not important when array is empty-->
|
||||
<property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@Image='JavadocNodeImpl']"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
<suppress checks="MultipleStringLiterals" files="JavadocStyleCheck\.java|AbstractTypeAwareCheck\.java|XMLLogger\.java"/>
|
||||
<suppress checks="MultipleStringLiterals" files=".*[\\/]src[\\/]test[\\/]"/>
|
||||
|
||||
<!-- There are a lot of setters/getters in the Check. A small number of methods is left for Check's logics -->
|
||||
<!-- There are a lot of setters/getters in the Check. A small number of methods is left for Check's logic -->
|
||||
<suppress checks="MethodCount" files="[\\/]JavadocMethodCheck.java$"/>
|
||||
|
||||
<!-- getDetails() method - huge Switch, it has to be monolithic -->
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
|
||||
<!-- we need that set of converters -->
|
||||
<suppress checks="ClassDataAbstractionCoupling" files="AutomaticBean\.java"/>
|
||||
<!-- they are agregators of logic, usage a several of classes are ok -->
|
||||
<!-- they are aggregators of logic, usage a several of classes are ok -->
|
||||
<suppress checks="ClassDataAbstractionCoupling" files="(Checker|TreeWalker|Main|CheckstyleAntTask|AbstractJavadocCheck)\.java"/>
|
||||
<suppress checks="ClassDataAbstractionCoupling" files="(CheckerTest|TreeWalkerTest)\.java"/>
|
||||
<!-- a lot of GUI elements is OK -->
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
<!-- Should be fixed after moving https://github.com/sevntu-checkstyle/sevntu.checkstyle/blob/master/sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/ReturnCountExtendedCheck.java into the main repo -->
|
||||
<suppress checks="ReturnCount" files="(ClassResolver|ConfigurationLoader|IndentationCheckTest)\.java"/>
|
||||
|
||||
<!-- Just big SWITCHes. Cannot be splitted to several methods. Till https://github.com/checkstyle/checkstyle/issues/2029 -->
|
||||
<!-- Just big switches. Cannot be split to several methods. Till https://github.com/checkstyle/checkstyle/issues/2029 -->
|
||||
<suppress checks="CyclomaticComplexity" files="(AbstractDeclarationCollector|SuppressWarningsHolder|LeftCurlyCheck|FallThroughCheck|FinalLocalVariableCheck|ModifiedControlVariableCheck)\.java"/>
|
||||
<suppress checks="CyclomaticComplexity" files="(ParameterAssignmentCheck|VariableDeclarationUsageDistanceCheck|BooleanExpressionComplexityCheck|NPathComplexityCheck|CheckUtils)\.java"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public class DesignForExtensionCheck extends Check {
|
|||
&& !classMods.branchContains(TokenTypes.FINAL);
|
||||
|
||||
if (nonEmptyImplementation && classCanBeSubclassed
|
||||
&& hasDefaultOrExplNonPrivateCtor(classDef)) {
|
||||
&& hasDefaultOrExplicitNonPrivateCtor(classDef)) {
|
||||
|
||||
final String name = ast.findFirstToken(TokenTypes.IDENT).getText();
|
||||
log(ast.getLineNo(), ast.getColumnNo(), MSG_KEY, name);
|
||||
|
|
@ -122,16 +122,16 @@ public class DesignForExtensionCheck extends Check {
|
|||
}
|
||||
|
||||
/**
|
||||
* Has Default Or Expl Non Private Ctor.
|
||||
* Has Default Or Explicit Non Private Ctor.
|
||||
* @param classDef class ast
|
||||
* @return true if Check should make a violation
|
||||
*/
|
||||
private static boolean hasDefaultOrExplNonPrivateCtor(DetailAST classDef) {
|
||||
private static boolean hasDefaultOrExplicitNonPrivateCtor(DetailAST classDef) {
|
||||
// check if subclassing is prevented by having only private ctors
|
||||
final DetailAST objBlock = classDef.findFirstToken(TokenTypes.OBJBLOCK);
|
||||
|
||||
boolean hasDefaultConstructor = true;
|
||||
boolean hasExplNonPrivateCtor = false;
|
||||
boolean hasExplicitNonPrivateCtor = false;
|
||||
|
||||
DetailAST candidate = objBlock.getFirstChild();
|
||||
|
||||
|
|
@ -142,14 +142,14 @@ public class DesignForExtensionCheck extends Check {
|
|||
final DetailAST ctorMods =
|
||||
candidate.findFirstToken(TokenTypes.MODIFIERS);
|
||||
if (!ctorMods.branchContains(TokenTypes.LITERAL_PRIVATE)) {
|
||||
hasExplNonPrivateCtor = true;
|
||||
hasExplicitNonPrivateCtor = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
candidate = candidate.getNextSibling();
|
||||
}
|
||||
|
||||
return hasDefaultConstructor || hasExplNonPrivateCtor;
|
||||
return hasDefaultConstructor || hasExplicitNonPrivateCtor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ final class ImportControlLoader extends AbstractLoader {
|
|||
|
||||
@Override
|
||||
public void startElement(final String namespaceURI,
|
||||
final String locqName,
|
||||
final String localName,
|
||||
final String qName,
|
||||
final Attributes attributes)
|
||||
throws SAXException {
|
||||
|
|
|
|||
|
|
@ -339,18 +339,18 @@ public class JavadocStyleCheck
|
|||
* the Javadoc comment.
|
||||
*/
|
||||
private void checkHtmlTags(final DetailAST ast, final TextBlock comment) {
|
||||
final int lineno = comment.getStartLineNo();
|
||||
final int lineNo = comment.getStartLineNo();
|
||||
final Deque<HtmlTag> htmlStack = new ArrayDeque<>();
|
||||
final String[] text = comment.getText();
|
||||
|
||||
final TagParser parser = new TagParser(text, lineno);
|
||||
final TagParser parser = new TagParser(text, lineNo);
|
||||
|
||||
while (parser.hasNextTag()) {
|
||||
final HtmlTag tag = parser.nextTag();
|
||||
|
||||
if (tag.isIncompleteTag()) {
|
||||
log(tag.getLineNo(), INCOMPLETE_TAG,
|
||||
text[tag.getLineNo() - lineno]);
|
||||
text[tag.getLineNo() - lineNo]);
|
||||
return;
|
||||
}
|
||||
if (tag.isClosedTag()) {
|
||||
|
|
|
|||
|
|
@ -76,12 +76,12 @@ class SinglelineDetector {
|
|||
|
||||
/**
|
||||
* Check a line for matches.
|
||||
* @param lineno the line number of the line to check
|
||||
* @param lineNo the line number of the line to check
|
||||
* @param line the line to check
|
||||
* @param matcher the matcher to use
|
||||
* @param startPosition the position to start searching from.
|
||||
*/
|
||||
private void checkLine(int lineno, String line, Matcher matcher,
|
||||
private void checkLine(int lineNo, String line, Matcher matcher,
|
||||
int startPosition) {
|
||||
final boolean foundMatch = matcher.find(startPosition);
|
||||
if (!foundMatch) {
|
||||
|
|
@ -96,10 +96,10 @@ class SinglelineDetector {
|
|||
// needs column number of the last character.
|
||||
// So we need to use (endCol - 1) here.
|
||||
if (options.getSuppressor()
|
||||
.shouldSuppress(lineno, startCol, lineno, endCol - 1)) {
|
||||
.shouldSuppress(lineNo, startCol, lineNo, endCol - 1)) {
|
||||
if (endCol < line.length()) {
|
||||
// check if the expression is on the rest of the line
|
||||
checkLine(lineno, line, matcher, endCol);
|
||||
checkLine(lineNo, line, matcher, endCol);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -107,11 +107,11 @@ class SinglelineDetector {
|
|||
currentMatches++;
|
||||
if (currentMatches > options.getMaximum()) {
|
||||
if (options.getMessage().isEmpty()) {
|
||||
options.getReporter().log(lineno, "regexp.exceeded",
|
||||
options.getReporter().log(lineNo, "regexp.exceeded",
|
||||
matcher.pattern().toString());
|
||||
}
|
||||
else {
|
||||
options.getReporter().log(lineno, options.getMessage());
|
||||
options.getReporter().log(lineNo, options.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class TreeTableCellRenderer extends JTree implements
|
|||
}
|
||||
|
||||
/**
|
||||
* Sublcassed to translate the graphics such that the last visible
|
||||
* Subclassed to translate the graphics such that the last visible
|
||||
* row will be drawn at 0,0.
|
||||
*/
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
messages.
|
||||
|
||||
The 'key' attribute specifies for which actual Checkstyle message the
|
||||
replacing should occur, look into Checkstyles message.properties for
|
||||
replacing should occur, look into Checkstyle's message.properties for
|
||||
the according message keys.
|
||||
|
||||
The 'value' attribute defines the custom message patterns including
|
||||
|
|
|
|||
|
|
@ -142,10 +142,10 @@ public class CheckerTest {
|
|||
checker.addFilter(filter);
|
||||
|
||||
filter.resetFilter();
|
||||
final SortedSet<LocalizedMessage> msgs = Sets.newTreeSet();
|
||||
msgs.add(new LocalizedMessage(0, 0, "a Bundle", "message.key",
|
||||
final SortedSet<LocalizedMessage> messages = Sets.newTreeSet();
|
||||
messages.add(new LocalizedMessage(0, 0, "a Bundle", "message.key",
|
||||
new Object[] {"arg"}, null, getClass(), null));
|
||||
checker.fireErrors("Some File Name", msgs);
|
||||
checker.fireErrors("Some File Name", messages);
|
||||
assertTrue("Checker.fireErrors() doesn't call filter", filter.wasCalled());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ public class MainTest {
|
|||
assertEquals("", systemErr.getLog());
|
||||
}
|
||||
});
|
||||
Main.main("-c", "/google_checks.xml", "NonexistingFile.java");
|
||||
Main.main("-c", "/google_checks.xml", "NonExistingFile.java");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
* flagged for only including the inheritDoc tag even in Java 5 compatibility mode.
|
||||
*/
|
||||
@Test
|
||||
public void testBadOverrideFromObjectJ5Compat() throws Exception {
|
||||
public void testBadOverrideFromObjectJ5Compatible() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
* Java 5 compatibility mode.
|
||||
*/
|
||||
@Test
|
||||
public void testBadOverrideFromOtherJ5Compat() throws Exception {
|
||||
public void testBadOverrideFromOtherJ5Compatible() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
* Java 5 compatibility mode.
|
||||
*/
|
||||
@Test
|
||||
public void testBadAnnotationOverrideJ5Compat() throws Exception {
|
||||
public void testBadAnnotationOverrideJ5Compatible() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
|
@ -169,7 +169,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
* flagged for only including the inheritDoc tag even in Java 5 compatibility mode.
|
||||
*/
|
||||
@Test
|
||||
public void testGoodOverrideFromObjectJ5Compat() throws Exception {
|
||||
public void testGoodOverrideFromObjectJ5Compatible() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
* Java 5 compatibility mode.
|
||||
*/
|
||||
@Test
|
||||
public void testGoodOverrideFromOtherJ5Compat() throws Exception {
|
||||
public void testGoodOverrideFromOtherJ5Compatible() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ public class MissingOverrideCheckTest extends BaseCheckTestSupport {
|
|||
* Java 5 compatibility mode.
|
||||
*/
|
||||
@Test
|
||||
public void testGoodAnnotationOverrideJ5Compat() throws Exception {
|
||||
public void testGoodAnnotationOverrideJ5Compatible() throws Exception {
|
||||
DefaultConfiguration checkConfig = createCheckConfig(MissingOverrideCheck.class);
|
||||
checkConfig.addAttribute("javaFiveCompatibility", "true");
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ public class HeaderCheckTest extends BaseFileSetCheckTestSupport {
|
|||
@Test
|
||||
public void testIoExceptionWhenLoadingHeaderFile() throws Exception {
|
||||
HeaderCheck check = PowerMockito.spy(new HeaderCheck());
|
||||
PowerMockito.doThrow(new IOException("excpected exception")).when(check, "loadHeader",
|
||||
PowerMockito.doThrow(new IOException("expected exception")).when(check, "loadHeader",
|
||||
anyObject());
|
||||
|
||||
check.setHeaderFile(getPath("InputRegexpHeader1.java"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue