diff options
author | Roman Ivanov <ivanov-jr@mail.ru> | 2015-11-21 17:51:07 -0800 |
---|---|---|
committer | Roman Ivanov <ivanov-jr@mail.ru> | 2015-11-21 17:51:07 -0800 |
commit | bf9325be913ce46a1427232c455f4830b574ba44 (patch) | |
tree | abff7b815e15c3df82cdd363e3b8f672c251182d /src/main | |
parent | fdd5ed77fd1ea61768683ee8cfacf78190a2d3aa (diff) | |
download | checkstyle-bf9325be913ce46a1427232c455f4830b574ba44.tar.gz |
Issue #2639: adjust AbbreviationAsWordInName in checkstyle_checks.xml to catch unexpected abbreviations
Diffstat (limited to 'src/main')
7 files changed, 22 insertions, 22 deletions
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java index cf38f7035..fb0c79883 100755 --- a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java @@ -268,12 +268,12 @@ public final class TreeWalker /** * Register a check for a specified token id. - * @param tokenID the id of the token + * @param tokenId the id of the token * @param check the check to register * @throws CheckstyleException if Check is misconfigured */ - private void registerCheck(int tokenID, Check check) throws CheckstyleException { - registerCheck(TokenUtils.getTokenName(tokenID), check); + private void registerCheck(int tokenId, Check check) throws CheckstyleException { + registerCheck(TokenUtils.getTokenName(tokenId), check); } /** diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java index ef9cfb3b4..7df11c89c 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractLoader.java @@ -107,10 +107,10 @@ public abstract class AbstractLoader publicIdToResourceNameMap.get(publicId); final ClassLoader loader = getClass().getClassLoader(); - final InputStream dtdIS = + final InputStream dtdIs = loader.getResourceAsStream(dtdResourceName); - return new InputSource(dtdIS); + return new InputSource(dtdIs); } return super.resolveEntity(publicId, systemId); } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java index f1338dbc6..67272f522 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/LocalizedMessage.java @@ -296,7 +296,7 @@ public final class LocalizedMessage .get(bundleName); if (resourceBundle == null) { resourceBundle = ResourceBundle.getBundle(bundleName, sLocale, - sourceClass.getClassLoader(), new UTF8Control()); + sourceClass.getClassLoader(), new Utf8Control()); BUNDLE_CACHE.put(bundleName, resourceBundle); } return resourceBundle; @@ -392,7 +392,7 @@ public final class LocalizedMessage * * @author <a href="mailto:nesterenko-aleksey@list.ru">Aleksey Nesterenko</a> */ - protected static class UTF8Control extends Control { + protected static class Utf8Control extends Control { @Override public ResourceBundle newBundle(String aBaseName, Locale aLocale, String aFormat, ClassLoader aLoader, boolean aReload) throws IOException { diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java index c7721511c..0805d0690 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java @@ -391,7 +391,7 @@ public class TranslationCheck } } catch (final IOException e) { - logIOException(e, file); + logIoException(e, file); } finally { Closeables.closeQuietly(inStream); @@ -404,7 +404,7 @@ public class TranslationCheck * @param ex the exception that occurred * @param file the file that could not be processed */ - private void logIOException(IOException ex, File file) { + private void logIoException(IOException ex, File file) { String[] args = null; String key = "general.fileNotFound"; if (!(ex instanceof FileNotFoundException)) { diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java index 8e3246bd7..f397d6c2a 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java @@ -78,10 +78,10 @@ public class HideUtilityClassConstructorCheck extends Check { // figure out if class extends java.lang.object directly // keep it simple for now and get a 99% solution - final boolean extendsJLO = + final boolean extendsJlo = ast.findFirstToken(TokenTypes.EXTENDS_CLAUSE) == null; - final boolean isUtilClass = extendsJLO && hasMethodOrField + final boolean isUtilClass = extendsJlo && hasMethodOrField && !hasNonStaticMethodOrField && hasNonPrivateStaticMethodOrField; if (isUtilClass && hasAccessibleCtor && !hasStaticModifier) { diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java index 1a4b9be90..39fab4548 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheck.java @@ -889,16 +889,16 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck { final String documentedEx = tag.getFirstArg(); final Token token = new Token(tag.getFirstArg(), tag.getLineNo(), tag .getColumnNo()); - final AbstractClassInfo documentedCI = createClassInfo(token, + final AbstractClassInfo documentedClassInfo = createClassInfo(token, getCurrentClassName()); final boolean found = foundThrows.contains(documentedEx) - || isInThrows(throwsList, documentedCI, foundThrows); + || isInThrows(throwsList, documentedClassInfo, foundThrows); // Handle extra JavadocTag. if (!found) { boolean reqd = true; if (allowUndeclaredRTE) { - reqd = !isUnchecked(documentedCI.getClazz()); + reqd = !isUnchecked(documentedClassInfo.getClazz()); } if (reqd && validateThrows) { @@ -927,12 +927,12 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck { * Verifies that documented exception is in throws. * * @param throwsList list of throws - * @param documentedCI documented exception class info + * @param documentedClassInfo documented exception class info * @param foundThrows previously found throws * @return true if documented exception is in throws. */ private boolean isInThrows(List<ExceptionInfo> throwsList, - AbstractClassInfo documentedCI, Set<String> foundThrows) { + AbstractClassInfo documentedClassInfo, Set<String> foundThrows) { boolean found = false; ExceptionInfo foundException = null; @@ -942,7 +942,7 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck { final ExceptionInfo exceptionInfo = throwIt.next(); if (exceptionInfo.getName().getText().equals( - documentedCI.getName().getText())) { + documentedClassInfo.getName().getText())) { found = true; foundException = exceptionInfo; } @@ -953,18 +953,18 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck { while (!found && exceptionInfoIt.hasNext()) { final ExceptionInfo exceptionInfo = exceptionInfoIt.next(); - if (documentedCI.getClazz() == exceptionInfo.getClazz()) { + if (documentedClassInfo.getClazz() == exceptionInfo.getClazz()) { found = true; foundException = exceptionInfo; } else if (allowThrowsTagsForSubclasses) { - found = isSubclass(documentedCI.getClazz(), exceptionInfo.getClazz()); + found = isSubclass(documentedClassInfo.getClazz(), exceptionInfo.getClazz()); } } if (foundException != null) { foundException.setFound(); - foundThrows.add(documentedCI.getName().getText()); + foundThrows.add(documentedClassInfo.getName().getText()); } return found; diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.java index fd9134183..9e2a309c2 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheck.java @@ -113,7 +113,7 @@ public class ModifierOrderCheck } if (!mods.isEmpty()) { - final DetailAST error = checkOrderSuggestedByJLS(mods); + final DetailAST error = checkOrderSuggestedByJls(mods); if (error != null) { if (error.getType() == TokenTypes.ANNOTATION) { log(error.getLineNo(), error.getColumnNo(), @@ -138,7 +138,7 @@ public class ModifierOrderCheck * @return null if the order is correct, otherwise returns the offending * modifier AST. */ - private static DetailAST checkOrderSuggestedByJLS(List<DetailAST> modifiers) { + private static DetailAST checkOrderSuggestedByJls(List<DetailAST> modifiers) { final Iterator<DetailAST> iterator = modifiers.iterator(); //Speed past all initial annotations |