diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/Defn.java b/src/main/java/com/puppycrawl/tools/checkstyle/Defn.java index af1ce18b0..cce9f034b 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/Defn.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/Defn.java @@ -24,14 +24,12 @@ package com.puppycrawl.tools.checkstyle; **/ public final class Defn { - ///CLOVER:OFF /** * Do no allow Defn instances to be created. **/ private Defn() { } - ///CLOVER:ON /** Name of resource bundle for Checkstyle. */ public static final String CHECKSTYLE_BUNDLE = diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java b/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java index 2078a645a..f4266acd9 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java @@ -108,25 +108,11 @@ class PackageObjectFactory implements ModuleFactory throws CheckstyleException { try { - final Class clazz = Class.forName(className, true, - moduleClassLoader); + final Class clazz = Class.forName(className, true, moduleClassLoader); return clazz.newInstance(); } - catch (final ClassNotFoundException e) { - throw new CheckstyleException( - "Unable to find class for " + className, e); - } - catch (final InstantiationException e) { - ///CLOVER:OFF - throw new CheckstyleException( - "Unable to instantiate " + className, e); - ///CLOVER:ON - } - catch (final IllegalAccessException e) { - ///CLOVER:OFF - throw new CheckstyleException( - "Unable to instantiate " + className, e); - ///CLOVER:ON + catch (final ClassNotFoundException | InstantiationException | IllegalAccessException e) { + throw new CheckstyleException("Unable to find class for " + className, e); } } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/ScopeUtils.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/ScopeUtils.java index 5871d0f91..d0c04ae3f 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/api/ScopeUtils.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/ScopeUtils.java @@ -27,12 +27,10 @@ import antlr.collections.AST; */ public final class ScopeUtils { - ///CLOVER:OFF /** prevent instantiation */ private ScopeUtils() { } - ///CLOVER:ON /** * Returns the Scope specified by the modifier set. diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory.java index 3276fa5fa..64e4b7583 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory.java @@ -63,7 +63,6 @@ public class HandlerFactory }); typeHandlers.put(type, ctor); } - ///CLOVER:OFF catch (final NoSuchMethodException e) { throw new RuntimeException("couldn't find ctor for " + handlerClass); @@ -73,7 +72,6 @@ public class HandlerFactory throw new RuntimeException("couldn't find ctor for " + handlerClass); } - ///CLOVER:ON } /** Creates a HandlerFactory. */ @@ -169,7 +167,6 @@ public class HandlerFactory indentCheck, ast, parent); } } - ///CLOVER:OFF catch (final InstantiationException e) { LOG.debug("couldn't instantiate constructor for " + ast, e); throw new RuntimeException("couldn't instantiate constructor for " @@ -188,7 +185,6 @@ public class HandlerFactory if (expHandler == null) { throw new RuntimeException("no handler for type " + ast.getType()); } - ///CLOVER:ON return expHandler; } diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocUtils.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocUtils.java index 7d4a88bc4..60b4b9a7e 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocUtils.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocUtils.java @@ -89,13 +89,11 @@ public final class JavadocUtils TOKEN_VALUE_TO_NAME = tempTokenValueToName; } - ///CLOVER:OFF /** prevent instantiation */ private JavadocUtils() { } - ///CLOVER:ON /** * Gets validTags from a given piece of Javadoc. diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java index 2b8555491..33f865501 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilter.java @@ -232,9 +232,7 @@ public class SuppressWithNearbyCommentFilter final Matcher matcher = regexp.matcher(comment); // Match primarily for effect. if (!matcher.find()) { - ///CLOVER:OFF return string; - ///CLOVER:ON } String result = string; for (int i = 0; i <= matcher.groupCount(); i++) { diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java index c06d81778..2b9a505ce 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java @@ -229,9 +229,7 @@ public class SuppressionCommentFilter final Matcher matcher = regexp.matcher(comment); // Match primarily for effect. if (!matcher.find()) { - ///CLOVER:OFF return string; - ///CLOVER:ON } String result = string; for (int i = 0; i <= matcher.groupCount(); i++) {