Issue #1566: First sentence in a comment should start with a capital letter
This commit is contained in:
parent
ae73562255
commit
54ccca1863
|
|
@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration;
|
|||
|
||||
public abstract class BaseCheckTestSupport
|
||||
{
|
||||
/** a brief logger that only display info about errors */
|
||||
/** A brief logger that only display info about errors */
|
||||
protected static class BriefLogger
|
||||
extends DefaultLogger
|
||||
{
|
||||
|
|
|
|||
|
|
@ -59,26 +59,26 @@ public class Checker extends AutomaticBean implements MessageDispatcher {
|
|||
/** Logger for Checker */
|
||||
private static final Log LOG = LogFactory.getLog(Checker.class);
|
||||
|
||||
/** maintains error count */
|
||||
/** Maintains error count */
|
||||
private final SeverityLevelCounter counter = new SeverityLevelCounter(
|
||||
SeverityLevel.ERROR);
|
||||
|
||||
/** vector of listeners */
|
||||
/** Vector of listeners */
|
||||
private final List<AuditListener> listeners = Lists.newArrayList();
|
||||
|
||||
/** vector of fileset checks */
|
||||
/** Vector of fileset checks */
|
||||
private final List<FileSetCheck> fileSetChecks = Lists.newArrayList();
|
||||
|
||||
/** class loader to resolve classes with. **/
|
||||
/** Class loader to resolve classes with. **/
|
||||
private ClassLoader classLoader = Thread.currentThread()
|
||||
.getContextClassLoader();
|
||||
|
||||
/** the basedir to strip off in filenames */
|
||||
/** The basedir to strip off in filenames */
|
||||
private String basedir;
|
||||
|
||||
/** locale country to report messages **/
|
||||
/** Locale country to report messages **/
|
||||
private String localeCountry = Locale.getDefault().getCountry();
|
||||
/** locale language to report messages **/
|
||||
/** Locale language to report messages **/
|
||||
private String localeLanguage = Locale.getDefault().getLanguage();
|
||||
|
||||
/** The factory for instantiating submodules */
|
||||
|
|
@ -87,13 +87,13 @@ public class Checker extends AutomaticBean implements MessageDispatcher {
|
|||
/** The classloader used for loading Checkstyle module classes. */
|
||||
private ClassLoader moduleClassLoader;
|
||||
|
||||
/** the context of all child components */
|
||||
/** The context of all child components */
|
||||
private Context childContext;
|
||||
|
||||
/** The audit event filters */
|
||||
private final FilterSet filters = new FilterSet();
|
||||
|
||||
/** the file extensions that are accepted */
|
||||
/** The file extensions that are accepted */
|
||||
private String[] fileExtensions = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
/**
|
||||
|
|
@ -292,7 +292,7 @@ public class Checker extends AutomaticBean implements MessageDispatcher {
|
|||
this.basedir = basedir;
|
||||
}
|
||||
|
||||
/** notify all listeners about the audit start */
|
||||
/** Notify all listeners about the audit start */
|
||||
protected void fireAuditStarted() {
|
||||
final AuditEvent evt = new AuditEvent(this);
|
||||
for (final AuditListener listener : listeners) {
|
||||
|
|
@ -300,7 +300,7 @@ public class Checker extends AutomaticBean implements MessageDispatcher {
|
|||
}
|
||||
}
|
||||
|
||||
/** notify all listeners about the audit end */
|
||||
/** Notify all listeners about the audit end */
|
||||
protected void fireAuditFinished() {
|
||||
final AuditEvent evt = new AuditEvent(this);
|
||||
for (final AuditListener listener : listeners) {
|
||||
|
|
|
|||
|
|
@ -57,49 +57,49 @@ public final class ConfigurationLoader {
|
|||
/** Logger for ConfigurationLoader. */
|
||||
private static final Log LOG = LogFactory.getLog(ConfigurationLoader.class);
|
||||
|
||||
/** the public ID for version 1_0 of the configuration dtd */
|
||||
/** The public ID for version 1_0 of the configuration dtd */
|
||||
private static final String DTD_PUBLIC_ID_1_0 =
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.0//EN";
|
||||
|
||||
/** the resource for version 1_0 of the configuration dtd */
|
||||
/** The resource for version 1_0 of the configuration dtd */
|
||||
private static final String DTD_RESOURCE_NAME_1_0 =
|
||||
"com/puppycrawl/tools/checkstyle/configuration_1_0.dtd";
|
||||
|
||||
/** the public ID for version 1_1 of the configuration dtd */
|
||||
/** The public ID for version 1_1 of the configuration dtd */
|
||||
private static final String DTD_PUBLIC_ID_1_1 =
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.1//EN";
|
||||
|
||||
/** the resource for version 1_1 of the configuration dtd */
|
||||
/** The resource for version 1_1 of the configuration dtd */
|
||||
private static final String DTD_RESOURCE_NAME_1_1 =
|
||||
"com/puppycrawl/tools/checkstyle/configuration_1_1.dtd";
|
||||
|
||||
/** the public ID for version 1_2 of the configuration dtd */
|
||||
/** The public ID for version 1_2 of the configuration dtd */
|
||||
private static final String DTD_PUBLIC_ID_1_2 =
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.2//EN";
|
||||
|
||||
/** the resource for version 1_2 of the configuration dtd */
|
||||
/** The resource for version 1_2 of the configuration dtd */
|
||||
private static final String DTD_RESOURCE_NAME_1_2 =
|
||||
"com/puppycrawl/tools/checkstyle/configuration_1_2.dtd";
|
||||
|
||||
/** the public ID for version 1_3 of the configuration dtd */
|
||||
/** The public ID for version 1_3 of the configuration dtd */
|
||||
private static final String DTD_PUBLIC_ID_1_3 =
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN";
|
||||
|
||||
/** the resource for version 1_3 of the configuration dtd */
|
||||
/** The resource for version 1_3 of the configuration dtd */
|
||||
private static final String DTD_RESOURCE_NAME_1_3 =
|
||||
"com/puppycrawl/tools/checkstyle/configuration_1_3.dtd";
|
||||
|
||||
/** the SAX document handler */
|
||||
/** The SAX document handler */
|
||||
private final InternalLoader saxHandler;
|
||||
|
||||
/** property resolver **/
|
||||
/** Property resolver **/
|
||||
private final PropertyResolver overridePropsResolver;
|
||||
/** the loaded configurations **/
|
||||
/** The loaded configurations **/
|
||||
private final Deque<DefaultConfiguration> configStack = new ArrayDeque<>();
|
||||
/** the Configuration that is being built */
|
||||
/** The Configuration that is being built */
|
||||
private Configuration configuration;
|
||||
|
||||
/** flags if modules with the severity 'ignore' should be omitted. */
|
||||
/** Flags if modules with the severity 'ignore' should be omitted. */
|
||||
private final boolean omitIgnoredModules;
|
||||
|
||||
/**
|
||||
|
|
@ -414,23 +414,23 @@ public final class ConfigurationLoader {
|
|||
*/
|
||||
private final class InternalLoader
|
||||
extends AbstractLoader {
|
||||
/** module elements */
|
||||
/** Module elements */
|
||||
private static final String MODULE = "module";
|
||||
/** name attribute */
|
||||
/** Name attribute */
|
||||
private static final String NAME = "name";
|
||||
/** property element */
|
||||
/** Property element */
|
||||
private static final String PROPERTY = "property";
|
||||
/** value attribute */
|
||||
/** Value attribute */
|
||||
private static final String VALUE = "value";
|
||||
/** default attribute */
|
||||
/** Default attribute */
|
||||
private static final String DEFAULT = "default";
|
||||
/** name of the severity property */
|
||||
/** Name of the severity property */
|
||||
private static final String SEVERITY = "severity";
|
||||
/** name of the message element */
|
||||
/** Name of the message element */
|
||||
private static final String MESSAGE = "message";
|
||||
/** name of the message element */
|
||||
/** Name of the message element */
|
||||
private static final String METADATA = "metadata";
|
||||
/** name of the key attribute */
|
||||
/** Name of the key attribute */
|
||||
private static final String KEY = "key";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,13 +40,13 @@ public final class DefaultConfiguration implements Configuration {
|
|||
/** The name of this configuration */
|
||||
private final String name;
|
||||
|
||||
/** the list of child Configurations */
|
||||
/** The list of child Configurations */
|
||||
private final List<Configuration> children = Lists.newArrayList();
|
||||
|
||||
/** the map from attribute names to attribute values */
|
||||
/** The map from attribute names to attribute values */
|
||||
private final Map<String, String> attributeMap = Maps.newHashMap();
|
||||
|
||||
/** the map containing custom messages. */
|
||||
/** The map containing custom messages. */
|
||||
private final Map<String, String> messages = Maps.newHashMap();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.Context;
|
|||
* @author lkuehne
|
||||
*/
|
||||
public final class DefaultContext implements Context {
|
||||
/** stores the context entries */
|
||||
/** Stores the context entries */
|
||||
private final Map<String, Object> entries = Maps.newHashMap();
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -43,17 +43,17 @@ import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
|
|||
public class DefaultLogger
|
||||
extends AutomaticBean
|
||||
implements AuditListener {
|
||||
/** cushion for avoiding StringBuffer.expandCapacity */
|
||||
/** Cushion for avoiding StringBuffer.expandCapacity */
|
||||
private static final int BUFFER_CUSHION = 12;
|
||||
|
||||
/** where to write info messages **/
|
||||
/** Where to write info messages **/
|
||||
private final PrintWriter infoWriter;
|
||||
/** close info stream after use */
|
||||
/** Close info stream after use */
|
||||
private final boolean closeInfo;
|
||||
|
||||
/** where to write error messages **/
|
||||
/** Where to write error messages **/
|
||||
private final PrintWriter errorWriter;
|
||||
/** close error stream after use */
|
||||
/** Close error stream after use */
|
||||
private final boolean closeError;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -394,15 +394,15 @@ public final class Main {
|
|||
|
||||
/** Helper structure to clear show what is required for Checker to run. **/
|
||||
private static class CliOptions {
|
||||
/** properties file location */
|
||||
/** Properties file location */
|
||||
private String propertiesLocation;
|
||||
/** config file location */
|
||||
/** Config file location */
|
||||
private String configLocation;
|
||||
/** output format */
|
||||
/** Output format */
|
||||
private String format;
|
||||
/** output file location */
|
||||
/** Output file location */
|
||||
private String outputLocation;
|
||||
/** list of file to validate */
|
||||
/** List of file to validate */
|
||||
private List<File> files;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,11 +46,11 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
|||
*/
|
||||
public final class PackageNamesLoader
|
||||
extends AbstractLoader {
|
||||
/** the public ID for the configuration dtd */
|
||||
/** The public ID for the configuration dtd */
|
||||
private static final String DTD_PUBLIC_ID =
|
||||
"-//Puppy Crawl//DTD Package Names 1.0//EN";
|
||||
|
||||
/** the resource for the configuration dtd */
|
||||
/** The resource for the configuration dtd */
|
||||
private static final String DTD_RESOURCE_NAME =
|
||||
"com/puppycrawl/tools/checkstyle/packages_1_0.dtd";
|
||||
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ class PackageObjectFactory implements ModuleFactory {
|
|||
/** Logger for PackageObjectFactory. */
|
||||
private static final Log LOG = LogFactory.getLog(PackageObjectFactory.class);
|
||||
|
||||
/** a list of package names to prepend to class names */
|
||||
/** A list of package names to prepend to class names */
|
||||
private final Set<String> packages;
|
||||
|
||||
/** the class loader used to load Checkstyle core and custom modules. */
|
||||
/** The class loader used to load Checkstyle core and custom modules. */
|
||||
private final ClassLoader moduleClassLoader;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import java.util.Properties;
|
|||
*/
|
||||
public final class PropertiesExpander
|
||||
implements PropertyResolver {
|
||||
/** the underlying Properties object. */
|
||||
/** The underlying Properties object. */
|
||||
private final Properties properties = new Properties();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -57,25 +57,25 @@ final class PropertyCacheFile {
|
|||
*/
|
||||
private static final String CONFIG_HASH_KEY = "configuration*?";
|
||||
|
||||
/** hex digits */
|
||||
/** Hex digits */
|
||||
private static final char[] HEX_CHARS = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
|
||||
};
|
||||
|
||||
/** mask for last byte */
|
||||
/** Mask for last byte */
|
||||
private static final int MASK_0X0F = 0x0F;
|
||||
|
||||
/** bit shift */
|
||||
/** Bit shift */
|
||||
private static final int SHIFT_4 = 4;
|
||||
|
||||
/** the details on files **/
|
||||
/** The details on files **/
|
||||
private final Properties details = new Properties();
|
||||
|
||||
/** configuration object **/
|
||||
/** Configuration object **/
|
||||
private final Configuration config;
|
||||
|
||||
/** file name of cache **/
|
||||
/** File name of cache **/
|
||||
private final String fileName;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
* @author Oliver Burn
|
||||
*/
|
||||
public final class ScopeUtils {
|
||||
/** prevent instantiation */
|
||||
/** Prevent instantiation */
|
||||
private ScopeUtils() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,39 +80,39 @@ public final class TreeWalker
|
|||
WITH_COMMENTS
|
||||
}
|
||||
|
||||
/** default distance between tab stops */
|
||||
/** Default distance between tab stops */
|
||||
private static final int DEFAULT_TAB_WIDTH = 8;
|
||||
|
||||
/** logger for debug purpose */
|
||||
/** Logger for debug purpose */
|
||||
private static final Log LOG = LogFactory.getLog(TreeWalker.class);
|
||||
|
||||
/** maps from token name to ordinary checks */
|
||||
/** Maps from token name to ordinary checks */
|
||||
private final Multimap<String, Check> tokenToOrdinaryChecks =
|
||||
HashMultimap.create();
|
||||
|
||||
/** maps from token name to comment checks */
|
||||
/** Maps from token name to comment checks */
|
||||
private final Multimap<String, Check> tokenToCommentChecks =
|
||||
HashMultimap.create();
|
||||
|
||||
/** registered ordinary checks, that don't use comment nodes */
|
||||
/** Registered ordinary checks, that don't use comment nodes */
|
||||
private final Set<Check> ordinaryChecks = Sets.newHashSet();
|
||||
|
||||
/** registered comment checks */
|
||||
/** Registered comment checks */
|
||||
private final Set<Check> commentChecks = Sets.newHashSet();
|
||||
|
||||
/** the distance between tab stops */
|
||||
/** The distance between tab stops */
|
||||
private int tabWidth = DEFAULT_TAB_WIDTH;
|
||||
|
||||
/** cache file **/
|
||||
/** Cache file **/
|
||||
private PropertyCacheFile cache;
|
||||
|
||||
/** class loader to resolve classes with. **/
|
||||
/** Class loader to resolve classes with. **/
|
||||
private ClassLoader classLoader;
|
||||
|
||||
/** context of child components */
|
||||
/** Context of child components */
|
||||
private Context childContext;
|
||||
|
||||
/** a factory for creating submodules (i.e. the Checks) */
|
||||
/** A factory for creating submodules (i.e. the Checks) */
|
||||
private ModuleFactory moduleFactory;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
*/
|
||||
public final class Utils {
|
||||
|
||||
/** maps from a token name to value */
|
||||
/** Maps from a token name to value */
|
||||
private static final ImmutableMap<String, Integer> TOKEN_NAME_TO_VALUE;
|
||||
/** maps from a token value to name */
|
||||
/** Maps from a token value to name */
|
||||
private static final String[] TOKEN_VALUE_TO_NAME;
|
||||
|
||||
/** Array of all token IDs */
|
||||
|
|
@ -84,7 +84,7 @@ public final class Utils {
|
|||
TOKEN_IDS = ArrayUtils.toPrimitive(ids);
|
||||
}
|
||||
|
||||
/** stop instances being created **/
|
||||
/** Stop instances being created **/
|
||||
private Utils() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,20 +42,20 @@ import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
|
|||
public class XMLLogger
|
||||
extends AutomaticBean
|
||||
implements AuditListener {
|
||||
/** decimal radix */
|
||||
/** Decimal radix */
|
||||
private static final int BASE_10 = 10;
|
||||
|
||||
/** hex radix */
|
||||
/** Hex radix */
|
||||
private static final int BASE_16 = 16;
|
||||
|
||||
/** some known entities to detect */
|
||||
/** Some known entities to detect */
|
||||
private static final String[] ENTITIES = {"gt", "amp", "lt", "apos",
|
||||
"quot", };
|
||||
|
||||
/** close output stream in auditFinished */
|
||||
/** Close output stream in auditFinished */
|
||||
private final boolean closeStream;
|
||||
|
||||
/** helper writer that allows easy encoding and printing */
|
||||
/** Helper writer that allows easy encoding and printing */
|
||||
private PrintWriter writer;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -60,42 +60,42 @@ import com.puppycrawl.tools.checkstyle.api.SeverityLevelCounter;
|
|||
* @author Oliver Burn
|
||||
*/
|
||||
public class CheckstyleAntTask extends Task {
|
||||
/** poor man's enum for an xml formatter */
|
||||
/** Poor man's enum for an xml formatter */
|
||||
private static final String E_XML = "xml";
|
||||
/** poor man's enum for an plain formatter */
|
||||
/** Poor man's enum for an plain formatter */
|
||||
private static final String E_PLAIN = "plain";
|
||||
|
||||
/** class path to locate class files */
|
||||
/** Class path to locate class files */
|
||||
private Path classpath;
|
||||
|
||||
/** name of file to check */
|
||||
/** Name of file to check */
|
||||
private String fileName;
|
||||
|
||||
/** config file containing configuration */
|
||||
/** Config file containing configuration */
|
||||
private String configLocation;
|
||||
|
||||
/** whether to fail build on violations */
|
||||
/** Whether to fail build on violations */
|
||||
private boolean failOnViolation = true;
|
||||
|
||||
/** property to set on violations */
|
||||
/** Property to set on violations */
|
||||
private String failureProperty;
|
||||
|
||||
/** contains the filesets to process */
|
||||
/** Contains the filesets to process */
|
||||
private final List<FileSet> fileSets = Lists.newArrayList();
|
||||
|
||||
/** contains the formatters to log to */
|
||||
/** Contains the formatters to log to */
|
||||
private final List<Formatter> formatters = Lists.newArrayList();
|
||||
|
||||
/** contains the Properties to override */
|
||||
/** Contains the Properties to override */
|
||||
private final List<Property> overrideProps = Lists.newArrayList();
|
||||
|
||||
/** the name of the properties file */
|
||||
/** The name of the properties file */
|
||||
private File propertiesFile;
|
||||
|
||||
/** the maximum number of errors that are tolerated. */
|
||||
/** The maximum number of errors that are tolerated. */
|
||||
private int maxErrors;
|
||||
|
||||
/** the maximum number of warnings that are tolerated. */
|
||||
/** The maximum number of warnings that are tolerated. */
|
||||
private int maxWarnings = Integer.MAX_VALUE;
|
||||
|
||||
/**
|
||||
|
|
@ -476,7 +476,7 @@ public class CheckstyleAntTask extends Task {
|
|||
* @author Oliver Burn
|
||||
*/
|
||||
public static class FormatterType extends EnumeratedAttribute {
|
||||
/** my possible values */
|
||||
/** My possible values */
|
||||
private static final String[] VALUES = {E_XML, E_PLAIN};
|
||||
|
||||
@Override
|
||||
|
|
@ -490,9 +490,9 @@ public class CheckstyleAntTask extends Task {
|
|||
* @author Oliver Burn
|
||||
*/
|
||||
public static class Formatter {
|
||||
/** the formatter type */
|
||||
/** The formatter type */
|
||||
private FormatterType formatterType;
|
||||
/** the file to output to */
|
||||
/** The file to output to */
|
||||
private File toFile;
|
||||
/** Whether or not the write to the named file. */
|
||||
private boolean useFile = true;
|
||||
|
|
@ -573,9 +573,9 @@ public class CheckstyleAntTask extends Task {
|
|||
* Represents a property that consists of a key and value.
|
||||
*/
|
||||
public static class Property {
|
||||
/** the property key */
|
||||
/** The property key */
|
||||
private String key;
|
||||
/** the property value */
|
||||
/** The property value */
|
||||
private String value;
|
||||
|
||||
/** @return the property key */
|
||||
|
|
@ -606,7 +606,7 @@ public class CheckstyleAntTask extends Task {
|
|||
|
||||
/** Represents a custom listener. */
|
||||
public static class Listener {
|
||||
/** classname of the listener class */
|
||||
/** Classname of the listener class */
|
||||
private String classname;
|
||||
|
||||
/** @return the classname */
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ public abstract class AbstractFileSetCheck
|
|||
/** The dispatcher errors are fired to. */
|
||||
private MessageDispatcher messageDispatcher;
|
||||
|
||||
/** the file extensions that are accepted by this filter */
|
||||
/** The file extensions that are accepted by this filter */
|
||||
private String[] fileExtensions = {};
|
||||
|
||||
/** collects the error messages */
|
||||
/** Collects the error messages */
|
||||
private final LocalizedMessages messages = new LocalizedMessages();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ import com.google.common.collect.Maps;
|
|||
*/
|
||||
public abstract class AbstractLoader
|
||||
extends DefaultHandler {
|
||||
/** maps public id to resolve to esource name for the DTD */
|
||||
/** Maps public id to resolve to esource name for the DTD */
|
||||
private final Map<String, String> publicIdToResourceNameMap;
|
||||
/** parser to read XML files **/
|
||||
/** Parser to read XML files **/
|
||||
private final XMLReader parser;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ import java.util.Map;
|
|||
*/
|
||||
public abstract class AbstractViolationReporter
|
||||
extends AutomaticBean {
|
||||
/** the severity level of any violations found */
|
||||
/** The severity level of any violations found */
|
||||
private SeverityLevel severityLevel = SeverityLevel.ERROR;
|
||||
|
||||
/** the identifier of the reporter */
|
||||
/** The identifier of the reporter */
|
||||
private String id;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ public final class AuditEvent
|
|||
extends EventObject {
|
||||
/** Record a version. */
|
||||
private static final long serialVersionUID = -3774725606973812736L;
|
||||
/** filename event associated with **/
|
||||
/** Filename event associated with **/
|
||||
private final String fileName;
|
||||
/** message associated with the event **/
|
||||
/** Message associated with the event **/
|
||||
private final LocalizedMessage message;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import com.google.common.collect.Lists;
|
|||
*/
|
||||
public class AutomaticBean
|
||||
implements Configurable, Contextualizable {
|
||||
/** the configuration of this bean */
|
||||
/** The configuration of this bean */
|
||||
private Configuration configuration;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,19 +35,19 @@ import com.puppycrawl.tools.checkstyle.Utils;
|
|||
* your own checks</a>
|
||||
*/
|
||||
public abstract class Check extends AbstractViolationReporter {
|
||||
/** default tab width for column reporting */
|
||||
/** Default tab width for column reporting */
|
||||
private static final int DEFAULT_TAB_WIDTH = 8;
|
||||
|
||||
/** the current file contents */
|
||||
/** The current file contents */
|
||||
private FileContents fileContents;
|
||||
|
||||
/** the tokens the check is interested in */
|
||||
/** The tokens the check is interested in */
|
||||
private final Set<String> tokens = Sets.newHashSet();
|
||||
|
||||
/** the object for collecting messages. */
|
||||
/** The object for collecting messages. */
|
||||
private LocalizedMessages messages;
|
||||
|
||||
/** the tab width for column reporting */
|
||||
/** The tab width for column reporting */
|
||||
private int tabWidth = DEFAULT_TAB_WIDTH; // meaningful default
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,19 +25,19 @@ package com.puppycrawl.tools.checkstyle.api;
|
|||
* @author o_sukhodolsky
|
||||
*/
|
||||
public class Comment implements TextBlock {
|
||||
/** text of the comment. */
|
||||
/** Text of the comment. */
|
||||
private final String[] text;
|
||||
|
||||
/** number of first line of the comment. */
|
||||
/** Number of first line of the comment. */
|
||||
private final int firstLine;
|
||||
|
||||
/** number of last line of the comment. */
|
||||
/** Number of last line of the comment. */
|
||||
private final int lastLine;
|
||||
|
||||
/** number of first column of the comment. */
|
||||
/** Number of first column of the comment. */
|
||||
private final int firstCol;
|
||||
|
||||
/** number of last column of the comment. */
|
||||
/** Number of last column of the comment. */
|
||||
private final int lastCol;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,19 +40,19 @@ public final class DetailAST extends CommonASTWithHiddenTokens {
|
|||
/** For Serialisation that will never happen. */
|
||||
private static final long serialVersionUID = -2580884815577559874L;
|
||||
|
||||
/** constant to indicate if not calculated the child count */
|
||||
/** Constant to indicate if not calculated the child count */
|
||||
private static final int NOT_INITIALIZED = Integer.MIN_VALUE;
|
||||
|
||||
/** the line number **/
|
||||
/** The line number **/
|
||||
private int lineNo = NOT_INITIALIZED;
|
||||
/** the column number **/
|
||||
/** The column number **/
|
||||
private int columnNo = NOT_INITIALIZED;
|
||||
|
||||
/** number of children */
|
||||
/** Number of children */
|
||||
private int childCount = NOT_INITIALIZED;
|
||||
/** the parent token */
|
||||
/** The parent token */
|
||||
private DetailAST parent;
|
||||
/** previous sibling */
|
||||
/** Previous sibling */
|
||||
private DetailAST previousSibling;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,21 +42,21 @@ public final class FileContents implements CommentListener {
|
|||
* itself -- no code.
|
||||
*/
|
||||
private static final String MATCH_SINGLELINE_COMMENT_PAT = "^\\s*//.*$";
|
||||
/** compiled regexp to match a single-line comment line */
|
||||
/** Compiled regexp to match a single-line comment line */
|
||||
private static final Pattern MATCH_SINGLELINE_COMMENT = Pattern
|
||||
.compile(MATCH_SINGLELINE_COMMENT_PAT);
|
||||
|
||||
/** the file name */
|
||||
/** The file name */
|
||||
private final String fileName;
|
||||
|
||||
/** the text */
|
||||
/** The text */
|
||||
private final FileText text;
|
||||
|
||||
/** map of the Javadoc comments indexed on the last line of the comment.
|
||||
/** Map of the Javadoc comments indexed on the last line of the comment.
|
||||
* The hack is it assumes that there is only one Javadoc comment per line.
|
||||
*/
|
||||
private final Map<Integer, TextBlock> javadocComments = Maps.newHashMap();
|
||||
/** map of the C++ comments indexed on the first line of the comment. */
|
||||
/** Map of the C++ comments indexed on the first line of the comment. */
|
||||
private final Map<Integer, TextBlock> cppComments =
|
||||
Maps.newHashMap();
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import com.google.common.collect.Sets;
|
|||
*/
|
||||
public class FilterSet
|
||||
implements Filter {
|
||||
/** filter set */
|
||||
/** Filter set */
|
||||
private final Set<Filter> filters = Sets.newHashSet();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ import org.apache.commons.lang3.StringUtils;
|
|||
* @see TokenTypes#IDENT
|
||||
**/
|
||||
public final class FullIdent {
|
||||
/** the list holding subsequent elements of identifier **/
|
||||
/** The list holding subsequent elements of identifier **/
|
||||
private final List<String> elements = new ArrayList<>();
|
||||
/** the line number **/
|
||||
/** The line number **/
|
||||
private int lineNo;
|
||||
/** the column number **/
|
||||
/** The column number **/
|
||||
private int colNo;
|
||||
|
||||
/** hide default constructor */
|
||||
/** Hide default constructor */
|
||||
private FullIdent() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -341,9 +341,9 @@ public enum JavadocTagInfo {
|
|||
TokenTypes.ANNOTATION_DEF,
|
||||
};
|
||||
|
||||
/** holds tag text to tag enum mappings **/
|
||||
/** Holds tag text to tag enum mappings **/
|
||||
private static final Map<String, JavadocTagInfo> TEXT_TO_TAG;
|
||||
/** holds tag name to tag enum mappings **/
|
||||
/** Holds tag name to tag enum mappings **/
|
||||
private static final Map<String, JavadocTagInfo> NAME_TO_TAG;
|
||||
|
||||
static {
|
||||
|
|
@ -366,11 +366,11 @@ public enum JavadocTagInfo {
|
|||
Arrays.sort(DEF_TOKEN_TYPES_DEPRECATED);
|
||||
}
|
||||
|
||||
/** the tag text **/
|
||||
/** The tag text **/
|
||||
private final String text;
|
||||
/** the tag name **/
|
||||
/** The tag name **/
|
||||
private final String name;
|
||||
/** the tag type **/
|
||||
/** The tag type **/
|
||||
private final Type type;
|
||||
|
||||
/**
|
||||
|
|
@ -496,10 +496,10 @@ public enum JavadocTagInfo {
|
|||
* @author Travis Schneeberger
|
||||
*/
|
||||
public enum Type {
|
||||
/** block type. **/
|
||||
/** Block type. **/
|
||||
BLOCK,
|
||||
|
||||
/** inline type. **/
|
||||
/** Inline type. **/
|
||||
INLINE
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public final class LocalizedMessage
|
|||
/** Required for serialization. */
|
||||
private static final long serialVersionUID = 5675176836184862150L;
|
||||
|
||||
/** the locale to localise messages to **/
|
||||
/** The locale to localise messages to **/
|
||||
private static Locale sLocale = Locale.getDefault();
|
||||
|
||||
/**
|
||||
|
|
@ -61,33 +61,33 @@ public final class LocalizedMessage
|
|||
private static final Map<String, ResourceBundle> BUNDLE_CACHE =
|
||||
Collections.synchronizedMap(new HashMap<String, ResourceBundle>());
|
||||
|
||||
/** the default severity level if one is not specified */
|
||||
/** The default severity level if one is not specified */
|
||||
private static final SeverityLevel DEFAULT_SEVERITY = SeverityLevel.ERROR;
|
||||
|
||||
/** the line number **/
|
||||
/** The line number **/
|
||||
private final int lineNo;
|
||||
/** the column number **/
|
||||
/** The column number **/
|
||||
private final int colNo;
|
||||
|
||||
/** the severity level **/
|
||||
/** The severity level **/
|
||||
private final SeverityLevel severityLevel;
|
||||
|
||||
/** the id of the module generating the message. */
|
||||
/** The id of the module generating the message. */
|
||||
private final String moduleId;
|
||||
|
||||
/** key for the message format **/
|
||||
/** Key for the message format **/
|
||||
private final String key;
|
||||
|
||||
/** arguments for MessageFormat **/
|
||||
/** Arguments for MessageFormat **/
|
||||
private final Object[] args;
|
||||
|
||||
/** name of the resource bundle to get messages from **/
|
||||
/** Name of the resource bundle to get messages from **/
|
||||
private final String bundle;
|
||||
|
||||
/** class of the source for this LocalizedMessage */
|
||||
/** Class of the source for this LocalizedMessage */
|
||||
private final Class<?> sourceClass;
|
||||
|
||||
/** a custom message overriding the default message from the bundle. */
|
||||
/** A custom message overriding the default message from the bundle. */
|
||||
private final String customMessage;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.common.collect.Sets;
|
|||
* @author Oliver Burn
|
||||
*/
|
||||
public final class LocalizedMessages {
|
||||
/** contains the messages logged **/
|
||||
/** Contains the messages logged **/
|
||||
private final Set<LocalizedMessage> messages = Sets.newTreeSet();
|
||||
|
||||
/** @return the logged messages **/
|
||||
|
|
|
|||
|
|
@ -29,17 +29,17 @@ import java.util.Locale;
|
|||
* @author Mehmet Can Cömert
|
||||
*/
|
||||
public enum Scope {
|
||||
/** nothing scope. */
|
||||
/** Nothing scope. */
|
||||
NOTHING,
|
||||
/** public scope. */
|
||||
/** Public scope. */
|
||||
PUBLIC,
|
||||
/** protected scope. */
|
||||
/** Protected scope. */
|
||||
PROTECTED,
|
||||
/** package or default scope. */
|
||||
/** Package or default scope. */
|
||||
PACKAGE,
|
||||
/** private scope. */
|
||||
/** Private scope. */
|
||||
PRIVATE,
|
||||
/** anonymous inner scope. */
|
||||
/** Anonymous inner scope. */
|
||||
ANONINNER;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -35,13 +35,13 @@ import java.util.Locale;
|
|||
* @author Mehmet Can Cömert
|
||||
*/
|
||||
public enum SeverityLevel {
|
||||
/** security level ignore. */
|
||||
/** Security level ignore. */
|
||||
IGNORE,
|
||||
/** security level info. */
|
||||
/** Security level info. */
|
||||
INFO,
|
||||
/** security level warning. */
|
||||
/** Security level warning. */
|
||||
WARNING,
|
||||
/** security level error. */
|
||||
/** Security level error. */
|
||||
ERROR;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -3480,7 +3480,7 @@ public final class TokenTypes {
|
|||
public static final int COMMENT_CONTENT =
|
||||
GeneratedJavaTokenTypes.COMMENT_CONTENT;
|
||||
|
||||
/** prevent instantiation */
|
||||
/** Prevent instantiation */
|
||||
private TokenTypes() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -244,14 +244,14 @@ public abstract class AbstractDeclarationCollector extends Check {
|
|||
varNames = Sets.newHashSet();
|
||||
}
|
||||
|
||||
/** add a name to the frame.
|
||||
/** Add a name to the frame.
|
||||
* @param nameToAdd the name we're adding
|
||||
*/
|
||||
void addName(String nameToAdd) {
|
||||
varNames.add(nameToAdd);
|
||||
}
|
||||
|
||||
/** check whether the frame contains a given name.
|
||||
/** Check whether the frame contains a given name.
|
||||
* @param nameToFind the name we're looking for
|
||||
* @return whether it was found
|
||||
*/
|
||||
|
|
@ -259,7 +259,7 @@ public abstract class AbstractDeclarationCollector extends Check {
|
|||
return varNames.contains(nameToFind);
|
||||
}
|
||||
|
||||
/** check whether the frame contains a given name.
|
||||
/** Check whether the frame contains a given name.
|
||||
* @param nameToFind the name we're looking for
|
||||
* @return whether it was found
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@ import com.puppycrawl.tools.checkstyle.api.Check;
|
|||
*/
|
||||
public abstract class AbstractFormatCheck
|
||||
extends Check {
|
||||
/** the flags to create the regular expression with */
|
||||
/** The flags to create the regular expression with */
|
||||
private int compileFlags;
|
||||
/** the regexp to match against */
|
||||
/** The regexp to match against */
|
||||
private Pattern regexp;
|
||||
/** the format string of the regexp */
|
||||
/** The format string of the regexp */
|
||||
private String format;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public abstract class AbstractOptionCheck<T extends Enum<T>>
|
|||
extends Check {
|
||||
/** Since I cannot get this by going <tt>T.class</tt>. */
|
||||
private final Class<T> optionClass;
|
||||
/** the policy to enforce */
|
||||
/** The policy to enforce */
|
||||
private T option;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
*/
|
||||
@Deprecated
|
||||
public abstract class AbstractTypeAwareCheck extends Check {
|
||||
/** imports details **/
|
||||
/** Imports details **/
|
||||
private final Set<String> imports = Sets.newHashSet();
|
||||
|
||||
/** full identifier for package of the method **/
|
||||
/** Full identifier for package of the method **/
|
||||
private FullIdent packageFullIdent;
|
||||
|
||||
/** Name of current class. */
|
||||
|
|
@ -416,13 +416,13 @@ public abstract class AbstractTypeAwareCheck extends Check {
|
|||
/** Represents regular classes/enumes. */
|
||||
@SuppressWarnings("deprecation")
|
||||
private static final class RegularClass extends AbstractClassInfo {
|
||||
/** name of surrounding class. */
|
||||
/** Name of surrounding class. */
|
||||
private final String surroundingClass;
|
||||
/** is class loadable. */
|
||||
/** Is class loadable. */
|
||||
private boolean loadable = true;
|
||||
/** {@code Class} object of this class if it's loadable. */
|
||||
private Class<?> classObj;
|
||||
/** the check we use to resolve classes. */
|
||||
/** The check we use to resolve classes. */
|
||||
private final AbstractTypeAwareCheck check;
|
||||
|
||||
/**
|
||||
|
|
@ -499,11 +499,11 @@ public abstract class AbstractTypeAwareCheck extends Check {
|
|||
* Represents text element with location in the text.
|
||||
*/
|
||||
protected static class Token {
|
||||
/** token's column number. */
|
||||
/** Token's column number. */
|
||||
private final int column;
|
||||
/** token's line number. */
|
||||
/** Token's line number. */
|
||||
private final int line;
|
||||
/** token's text. */
|
||||
/** Token's text. */
|
||||
private final String text;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
* @author lkuehne
|
||||
*/
|
||||
public class ArrayTypeStyleCheck extends Check {
|
||||
/** controls whether to use Java or C style */
|
||||
/** Controls whether to use Java or C style */
|
||||
private boolean javaStyle = true;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
*/
|
||||
public final class CheckUtils {
|
||||
// constants for parseDouble()
|
||||
/** octal radix */
|
||||
/** Octal radix */
|
||||
private static final int BASE_8 = 8;
|
||||
|
||||
/** decimal radix */
|
||||
/** Decimal radix */
|
||||
private static final int BASE_10 = 10;
|
||||
|
||||
/** hex radix */
|
||||
/** Hex radix */
|
||||
private static final int BASE_16 = 16;
|
||||
|
||||
/** Maximum children allowed in setter/getter */
|
||||
|
|
@ -54,7 +54,7 @@ public final class CheckUtils {
|
|||
/** Maximum nodes allowed in a body of getter */
|
||||
private static final int GETTER_BODY_SIZE = 2;
|
||||
|
||||
/** prevent instances */
|
||||
/** Prevent instances */
|
||||
private CheckUtils() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ import java.util.Set;
|
|||
* @author Oliver Burn
|
||||
*/
|
||||
public class ClassResolver {
|
||||
/** name of the package to check if the class belongs to **/
|
||||
/** Name of the package to check if the class belongs to **/
|
||||
private final String pkg;
|
||||
/** set of imports to check against **/
|
||||
/** Set of imports to check against **/
|
||||
private final Set<String> imports;
|
||||
/** use to load classes **/
|
||||
/** Use to load classes **/
|
||||
private final ClassLoader loader;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -192,21 +192,21 @@ public class DescendantTokenCheck extends Check {
|
|||
*/
|
||||
public static final String MSG_KEY_SUM_MAX = "descendant.token.sum.max";
|
||||
|
||||
/** minimum depth */
|
||||
/** Minimum depth */
|
||||
private int minimumDepth;
|
||||
/** maximum depth */
|
||||
/** Maximum depth */
|
||||
private int maximumDepth = Integer.MAX_VALUE;
|
||||
/** minimum number */
|
||||
/** Minimum number */
|
||||
private int minimumNumber;
|
||||
/** maximum number */
|
||||
/** Maximum number */
|
||||
private int maximumNumber = Integer.MAX_VALUE;
|
||||
/** Whether to sum the number of tokens found. */
|
||||
private boolean sumTokenCounts;
|
||||
/** limited tokens */
|
||||
/** Limited tokens */
|
||||
private int[] limitedTokens = ArrayUtils.EMPTY_INT_ARRAY;
|
||||
/** error message when minimum count not reached */
|
||||
/** Error message when minimum count not reached */
|
||||
private String minimumMessage;
|
||||
/** error message when maximum count exceeded */
|
||||
/** Error message when maximum count exceeded */
|
||||
private String maximumMessage;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public enum LineSeparatorOption {
|
|||
/** System default line separators. **/
|
||||
SYSTEM(System.getProperty("line.separator"));
|
||||
|
||||
/** the line separator representation */
|
||||
/** The line separator representation */
|
||||
private final byte[] lineSeparator;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class NewlineAtEndOfFileCheck
|
|||
*/
|
||||
public static final String MSG_KEY_NO_NEWLINE_EOF = "noNewlineAtEOF";
|
||||
|
||||
/** the line separator to check against. */
|
||||
/** The line separator to check against. */
|
||||
private LineSeparatorOption lineSeparator = LineSeparatorOption.SYSTEM;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
* @author maxvetrenko
|
||||
*/
|
||||
public class OuterTypeFilenameCheck extends Check {
|
||||
/** indicates whether the first token has been seen in the file. */
|
||||
/** Indicates whether the first token has been seen in the file. */
|
||||
private boolean seenFirstToken;
|
||||
|
||||
/** Current file name*/
|
||||
|
|
|
|||
|
|
@ -56,13 +56,13 @@ public class SuppressWarningsHolder
|
|||
*/
|
||||
public static final String CHECKSTYLE_PREFIX = "checkstyle:";
|
||||
|
||||
/** java.lang namespace prefix, which is stripped from SuppressWarnings */
|
||||
/** Java.lang namespace prefix, which is stripped from SuppressWarnings */
|
||||
private static final String JAVA_LANG_PREFIX = "java.lang.";
|
||||
|
||||
/** suffix to be removed from subclasses of Check */
|
||||
/** Suffix to be removed from subclasses of Check */
|
||||
private static final String CHECK_SUFFIX = "Check";
|
||||
|
||||
/** a map from check source names to suppression aliases */
|
||||
/** A map from check source names to suppression aliases */
|
||||
private static final Map<String, String> CHECK_ALIAS_MAP = new HashMap<>();
|
||||
|
||||
/**
|
||||
|
|
@ -423,17 +423,17 @@ public class SuppressWarningsHolder
|
|||
"Expression or annotation array initializer AST expected: " + ast);
|
||||
}
|
||||
|
||||
/** records a particular suppression for a region of a file */
|
||||
/** Records a particular suppression for a region of a file */
|
||||
private static class Entry {
|
||||
/** the source name of the suppressed check */
|
||||
/** The source name of the suppressed check */
|
||||
private final String checkName;
|
||||
/** the suppression region for the check - first line */
|
||||
/** The suppression region for the check - first line */
|
||||
private final int firstLine;
|
||||
/** the suppression region for the check - first column */
|
||||
/** The suppression region for the check - first column */
|
||||
private final int firstColumn;
|
||||
/** the suppression region for the check - last line */
|
||||
/** The suppression region for the check - last line */
|
||||
private final int lastLine;
|
||||
/** the suppression region for the check - last column */
|
||||
/** The suppression region for the check - last column */
|
||||
private final int lastColumn;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -107,10 +107,10 @@ public class TrailingCommentCheck extends AbstractFormatCheck {
|
|||
*/
|
||||
public static final String MSG_KEY = "trailing.comments";
|
||||
|
||||
/** default format for allowed blank line. */
|
||||
/** Default format for allowed blank line. */
|
||||
private static final String DEFAULT_FORMAT = "^[\\s\\}\\);]*$";
|
||||
|
||||
/** pattern for legal trailing comment. */
|
||||
/** Pattern for legal trailing comment. */
|
||||
private Pattern legalComment;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -48,16 +48,16 @@ public class UncommentedMainCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "uncommented.main";
|
||||
|
||||
/** the pattern to exclude classes from the check */
|
||||
/** The pattern to exclude classes from the check */
|
||||
private String excludedClasses = "^$";
|
||||
/** compiled regexp to exclude classes from check */
|
||||
/** Compiled regexp to exclude classes from check */
|
||||
private Pattern excludedClassesPattern =
|
||||
Utils.createPattern(excludedClasses);
|
||||
/** current class name */
|
||||
/** Current class name */
|
||||
private String currentClass;
|
||||
/** current package */
|
||||
/** Current package */
|
||||
private FullIdent packageName;
|
||||
/** class definition depth */
|
||||
/** Class definition depth */
|
||||
private int classDepth;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -96,18 +96,18 @@ public final class MissingDeprecatedCheck extends Check {
|
|||
/** {@link Deprecated Deprecated} annotation name */
|
||||
private static final String DEPRECATED = "Deprecated";
|
||||
|
||||
/** fully-qualified {@link Deprecated Deprecated} annotation name */
|
||||
/** Fully-qualified {@link Deprecated Deprecated} annotation name */
|
||||
private static final String FQ_DEPRECATED = "java.lang." + DEPRECATED;
|
||||
|
||||
/** compiled regexp to match Javadoc tag with no argument * */
|
||||
/** Compiled regexp to match Javadoc tag with no argument * */
|
||||
private static final Pattern MATCH_DEPRECATED =
|
||||
Utils.createPattern("@(deprecated)\\s+\\S");
|
||||
|
||||
/** compiled regexp to match first part of multilineJavadoc tags * */
|
||||
/** Compiled regexp to match first part of multilineJavadoc tags * */
|
||||
private static final Pattern MATCH_DEPRECATED_MULTILINE_START =
|
||||
Utils.createPattern("@(deprecated)\\s*$");
|
||||
|
||||
/** compiled regexp to look for a continuation of the comment * */
|
||||
/** Compiled regexp to look for a continuation of the comment * */
|
||||
private static final Pattern MATCH_DEPRECATED_MULTILINE_CONT =
|
||||
Utils.createPattern("(\\*/|@|[^\\s\\*])");
|
||||
|
||||
|
|
|
|||
|
|
@ -92,10 +92,10 @@ public final class MissingOverrideCheck extends Check {
|
|||
/** {@link Override Override} annotation name */
|
||||
private static final String OVERRIDE = "Override";
|
||||
|
||||
/** fully-qualified {@link Override Override} annotation name */
|
||||
/** Fully-qualified {@link Override Override} annotation name */
|
||||
private static final String FQ_OVERRIDE = "java.lang." + OVERRIDE;
|
||||
|
||||
/** compiled regexp to match Javadoc tags with no argument and {} * */
|
||||
/** Compiled regexp to match Javadoc tags with no argument and {} * */
|
||||
private static final Pattern MATCH_INHERITDOC =
|
||||
Utils.createPattern("\\{\\s*@(inheritDoc)\\s*\\}");
|
||||
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
|||
* @author <a href="mailto:simon@redhillconsulting.com.au">Simon Harris</a>
|
||||
*/
|
||||
public abstract class AbstractNestedDepthCheck extends Check {
|
||||
/** maximum allowed nesting depth */
|
||||
/** Maximum allowed nesting depth */
|
||||
private int max;
|
||||
/** current nesting depth */
|
||||
/** Current nesting depth */
|
||||
private int depth;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public abstract class AbstractSuperCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "missing.super.call";
|
||||
|
||||
/** stack of methods */
|
||||
/** Stack of methods */
|
||||
private final Deque<MethodNode> methodStack = Lists.newLinkedList();
|
||||
|
||||
@Override
|
||||
|
|
@ -194,10 +194,10 @@ public abstract class AbstractSuperCheck
|
|||
* @author Rick Giles
|
||||
*/
|
||||
private static class MethodNode {
|
||||
/** method definition */
|
||||
/** Method definition */
|
||||
private final DetailAST method;
|
||||
|
||||
/** true if the overriding method calls the super method */
|
||||
/** True if the overriding method calls the super method */
|
||||
private boolean callingSuper;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@ public class EqualsHashCodeCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "equals.noHashCode";
|
||||
|
||||
/** maps OBJ_BLOCK to the method definition of equals() */
|
||||
/** Maps OBJ_BLOCK to the method definition of equals() */
|
||||
private final Map<DetailAST, DetailAST> objBlockEquals = Maps.newHashMap();
|
||||
|
||||
/** the set of OBJ_BLOCKs that contain a definition of hashCode() */
|
||||
/** The set of OBJ_BLOCKs that contain a definition of hashCode() */
|
||||
private final Set<DetailAST> objBlockWithHashCode = Sets.newHashSet();
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -135,15 +135,15 @@ public class HiddenFieldCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "hidden.field";
|
||||
|
||||
/** stack of sets of field names,
|
||||
/** Stack of sets of field names,
|
||||
* one for each class of a set of nested classes.
|
||||
*/
|
||||
private FieldFrame currentFrame;
|
||||
|
||||
/** pattern for names of variables and parameters to ignore. */
|
||||
/** Pattern for names of variables and parameters to ignore. */
|
||||
private Pattern regexp;
|
||||
|
||||
/** controls whether to check the parameter of a property setter method */
|
||||
/** Controls whether to check the parameter of a property setter method */
|
||||
private boolean ignoreSetter;
|
||||
|
||||
/**
|
||||
|
|
@ -154,10 +154,10 @@ public class HiddenFieldCheck
|
|||
*/
|
||||
private boolean setterCanReturnItsClass;
|
||||
|
||||
/** controls whether to check the parameter of a constructor */
|
||||
/** Controls whether to check the parameter of a constructor */
|
||||
private boolean ignoreConstructorParameter;
|
||||
|
||||
/** controls whether to check the parameter of abstract methods. */
|
||||
/** Controls whether to check the parameter of abstract methods. */
|
||||
private boolean ignoreAbstractMethods;
|
||||
|
||||
@Override
|
||||
|
|
@ -518,19 +518,19 @@ public class HiddenFieldCheck
|
|||
* @author Rick Giles
|
||||
*/
|
||||
private static class FieldFrame {
|
||||
/** name of the frame, such name of the class or enum declaration */
|
||||
/** Name of the frame, such name of the class or enum declaration */
|
||||
private final String frameName;
|
||||
|
||||
/** is this a static inner type */
|
||||
/** Is this a static inner type */
|
||||
private final boolean staticType;
|
||||
|
||||
/** parent frame. */
|
||||
/** Parent frame. */
|
||||
private final FieldFrame parent;
|
||||
|
||||
/** set of instance field names */
|
||||
/** Set of instance field names */
|
||||
private final Set<String> instanceFields = Sets.newHashSet();
|
||||
|
||||
/** set of static field names */
|
||||
/** Set of static field names */
|
||||
private final Set<String> staticFields = Sets.newHashSet();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -76,16 +76,16 @@ public class IllegalInstantiationCheck
|
|||
/** Set of fully qualified classnames. E.g. "java.lang.Boolean" */
|
||||
private final Set<String> illegalClasses = Sets.newHashSet();
|
||||
|
||||
/** name of the package */
|
||||
/** Name of the package */
|
||||
private String pkgName;
|
||||
|
||||
/** the imports for the file */
|
||||
/** The imports for the file */
|
||||
private final Set<FullIdent> imports = Sets.newHashSet();
|
||||
|
||||
/** the class names defined in the file */
|
||||
/** The class names defined in the file */
|
||||
private final Set<String> classNames = Sets.newHashSet();
|
||||
|
||||
/** the instantiations in the file */
|
||||
/** The instantiations in the file */
|
||||
private final Set<DetailAST> instantiations = Sets.newHashSet();
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ public final class IllegalThrowsCheck extends AbstractIllegalCheck {
|
|||
"finalize",
|
||||
};
|
||||
|
||||
/** property for ignoring overridden methods. */
|
||||
/** Property for ignoring overridden methods. */
|
||||
private boolean ignoreOverriddenMethods = true;
|
||||
|
||||
/** methods which should be ignored. */
|
||||
/** Methods which should be ignored. */
|
||||
private final Set<String> ignoredMethodNames = Sets.newHashSet();
|
||||
|
||||
/** Creates new instance of the check. */
|
||||
|
|
|
|||
|
|
@ -130,13 +130,13 @@ public final class IllegalTypeCheck extends AbstractFormatCheck {
|
|||
"getEnvironment",
|
||||
};
|
||||
|
||||
/** illegal classes. */
|
||||
/** Illegal classes. */
|
||||
private final Set<String> illegalClassNames = Sets.newHashSet();
|
||||
/** legal abstract classes. */
|
||||
/** Legal abstract classes. */
|
||||
private final Set<String> legalAbstractClassNames = Sets.newHashSet();
|
||||
/** methods which should be ignored. */
|
||||
/** Methods which should be ignored. */
|
||||
private final Set<String> ignoredMethodNames = Sets.newHashSet();
|
||||
/** check methods and fields with only corresponding modifiers. */
|
||||
/** Check methods and fields with only corresponding modifiers. */
|
||||
private List<Integer> memberModifiers;
|
||||
|
||||
/** Creates new instance of the check. */
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ public class MagicNumberCheck extends Check {
|
|||
TokenTypes.MINUS,
|
||||
};
|
||||
|
||||
/** the numbers to ignore in the check, sorted */
|
||||
/** The numbers to ignore in the check, sorted */
|
||||
private double[] ignoreNumbers = {-1, 0, 1, 2};
|
||||
|
||||
/** Whether to ignore magic numbers in a hash code method. */
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public final class NestedForDepthCheck extends AbstractNestedDepthCheck {
|
|||
*/
|
||||
public static final String MSG_KEY = "nested.for.depth";
|
||||
|
||||
/** default allowed nesting depth. */
|
||||
/** Default allowed nesting depth. */
|
||||
private static final int DEFAULT_MAX = 1;
|
||||
|
||||
/** Creates new check instance with default allowed nesting depth. */
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public final class NestedIfDepthCheck extends AbstractNestedDepthCheck {
|
|||
*/
|
||||
public static final String MSG_KEY = "nested.if.depth";
|
||||
|
||||
/** default allowed nesting depth. */
|
||||
/** Default allowed nesting depth. */
|
||||
private static final int DEFAULT_MAX = 1;
|
||||
|
||||
/** Creates new check instance with default allowed nesting depth. */
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class NestedTryDepthCheck extends AbstractNestedDepthCheck {
|
|||
*/
|
||||
public static final String MSG_KEY = "nested.try.depth";
|
||||
|
||||
/** default allowed nesting depth */
|
||||
/** Default allowed nesting depth */
|
||||
private static final int DEFAULT_MAX = 1;
|
||||
|
||||
/** Creates new check instance with default allowed nesting depth. */
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public final class PackageDeclarationCheck extends Check {
|
|||
/** Line number used to log violation when no AST nodes are present in file. */
|
||||
private static final int DEFAULT_LINE_NUMBER = 1;
|
||||
|
||||
/** is package defined. */
|
||||
/** Is package defined. */
|
||||
private boolean defined;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@ public class RequireThisCheck extends AbstractDeclarationCollector {
|
|||
*/
|
||||
public static final String MSG_VARIABLE = "require.this.variable";
|
||||
|
||||
/** whether we should check fields usage. */
|
||||
/** Whether we should check fields usage. */
|
||||
private boolean checkFields = true;
|
||||
/** whether we should check methods usage. */
|
||||
/** Whether we should check methods usage. */
|
||||
private boolean checkMethods = true;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -104,18 +104,18 @@ public class FinalClassCheck
|
|||
}
|
||||
}
|
||||
|
||||
/** maintains information about class' ctors */
|
||||
/** Maintains information about class' ctors */
|
||||
private static final class ClassDesc {
|
||||
/** is class declared as final */
|
||||
/** Is class declared as final */
|
||||
private final boolean declaredAsFinal;
|
||||
|
||||
/** is class declared as abstract */
|
||||
/** Is class declared as abstract */
|
||||
private final boolean declaredAsAbstract;
|
||||
|
||||
/** does class have non-provate ctors */
|
||||
/** Does class have non-provate ctors */
|
||||
private boolean withNonPrivateCtor;
|
||||
|
||||
/** does class have private ctors */
|
||||
/** Does class have private ctors */
|
||||
private boolean withPrivateCtor;
|
||||
|
||||
/**
|
||||
|
|
@ -130,12 +130,12 @@ public class FinalClassCheck
|
|||
this.declaredAsAbstract = declaredAsAbstract;
|
||||
}
|
||||
|
||||
/** adds private ctor. */
|
||||
/** Adds private ctor. */
|
||||
void reportPrivateCtor() {
|
||||
withPrivateCtor = true;
|
||||
}
|
||||
|
||||
/** adds non-private ctor. */
|
||||
/** Adds non-private ctor. */
|
||||
void reportNonPrivateCtor() {
|
||||
withNonPrivateCtor = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,20 +111,20 @@ public class HideUtilityClassConstructorCheck extends Check {
|
|||
* Details of class that are required for validation
|
||||
*/
|
||||
private static class Details {
|
||||
/** class ast */
|
||||
/** Class ast */
|
||||
private final DetailAST ast;
|
||||
/** result of details gathering */
|
||||
/** Result of details gathering */
|
||||
private boolean hasMethodOrField;
|
||||
/** result of details gathering */
|
||||
/** Result of details gathering */
|
||||
private boolean hasNonStaticMethodOrField;
|
||||
/** result of details gathering */
|
||||
/** Result of details gathering */
|
||||
private boolean hasNonPrivateStaticMethodOrField;
|
||||
/** result of details gathering */
|
||||
/** Result of details gathering */
|
||||
private boolean hasDefaultCtor;
|
||||
/** result of details gathering */
|
||||
/** Result of details gathering */
|
||||
private boolean hasPublicCtor;
|
||||
|
||||
/** c-tor
|
||||
/** C-tor
|
||||
* @param ast class ast
|
||||
* */
|
||||
Details(DetailAST ast) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public final class InterfaceIsTypeCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "interface.type";
|
||||
|
||||
/** flag to control whether marker interfaces are allowed. */
|
||||
/** Flag to control whether marker interfaces are allowed. */
|
||||
private boolean allowMarkerInterfaces = true;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -60,13 +60,13 @@ public final class ThrowsCountCheck extends Check {
|
|||
*/
|
||||
public static final String MSG_KEY = "throws.count";
|
||||
|
||||
/** default value of max property */
|
||||
/** Default value of max property */
|
||||
private static final int DEFAULT_MAX = 4;
|
||||
|
||||
/** whether private methods must be ignored **/
|
||||
/** Whether private methods must be ignored **/
|
||||
private boolean ignorePrivateMethods = true;
|
||||
|
||||
/** maximum allowed throws statements */
|
||||
/** Maximum allowed throws statements */
|
||||
private int max;
|
||||
|
||||
/** Creates new instance of the check. */
|
||||
|
|
|
|||
|
|
@ -270,13 +270,13 @@ public class VisibilityModifierCheck
|
|||
"com.google.common.annotations.VisibleForTesting"
|
||||
);
|
||||
|
||||
/** contains explicit access modifiers. */
|
||||
/** Contains explicit access modifiers. */
|
||||
private static final String[] EXPLICIT_MODS = {"public", "private", "protected"};
|
||||
|
||||
/** whether protected members are allowed */
|
||||
/** Whether protected members are allowed */
|
||||
private boolean protectedAllowed;
|
||||
|
||||
/** whether package visible members are allowed */
|
||||
/** Whether package visible members are allowed */
|
||||
private boolean packageAllowed;
|
||||
|
||||
/**
|
||||
|
|
@ -288,7 +288,7 @@ public class VisibilityModifierCheck
|
|||
*/
|
||||
private String publicMemberFormat = "^serialVersionUID$";
|
||||
|
||||
/** regexp for public members that should be ignored */
|
||||
/** Regexp for public members that should be ignored */
|
||||
private Pattern publicMemberPattern = Pattern.compile(publicMemberFormat);
|
||||
|
||||
/** List of ignore annotations canonical names. */
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck {
|
|||
/** Name of a charset to use for loading the header from a file. */
|
||||
private String charset = System.getProperty("file.encoding", "UTF-8");
|
||||
|
||||
/** the lines of the header file. */
|
||||
/** The lines of the header file. */
|
||||
private final List<String> readerLines = Lists.newArrayList();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,10 +45,10 @@ public class HeaderCheck extends AbstractHeaderCheck {
|
|||
*/
|
||||
public static final String MSG_MISMATCH = "header.mismatch";
|
||||
|
||||
/** empty array to avoid instantiations. */
|
||||
/** Empty array to avoid instantiations. */
|
||||
private static final int[] EMPTY_INT_ARRAY = new int[0];
|
||||
|
||||
/** the header lines to ignore in the check, sorted. */
|
||||
/** The header lines to ignore in the check, sorted. */
|
||||
private int[] ignoreLines = EMPTY_INT_ARRAY;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,13 +42,13 @@ import com.puppycrawl.tools.checkstyle.Utils;
|
|||
* @author o_sukhodolsky
|
||||
*/
|
||||
public class RegexpHeaderCheck extends AbstractHeaderCheck {
|
||||
/** empty array to avoid instantiations. */
|
||||
/** Empty array to avoid instantiations. */
|
||||
private static final int[] EMPTY_INT_ARRAY = new int[0];
|
||||
|
||||
/** the compiled regular expressions */
|
||||
/** The compiled regular expressions */
|
||||
private final List<Pattern> headerRegexps = Lists.newArrayList();
|
||||
|
||||
/** the header lines to repeat (0 or more) in the check, sorted. */
|
||||
/** The header lines to repeat (0 or more) in the check, sorted. */
|
||||
private int[] multiLines = EMPTY_INT_ARRAY;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -72,13 +72,13 @@ public class AvoidStarImportCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "import.avoidStar";
|
||||
|
||||
/** the packages/classes to exempt from this check. */
|
||||
/** The packages/classes to exempt from this check. */
|
||||
private final List<String> excludes = Lists.newArrayList();
|
||||
|
||||
/** whether to allow all class imports */
|
||||
/** Whether to allow all class imports */
|
||||
private boolean allowClassImports;
|
||||
|
||||
/** whether to allow all static member imports */
|
||||
/** Whether to allow all static member imports */
|
||||
private boolean allowStaticMemberImports;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class AvoidStaticImportCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "import.avoidStatic";
|
||||
|
||||
/** the classes/static members to exempt from this check. */
|
||||
/** The classes/static members to exempt from this check. */
|
||||
private String[] excludes = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class IllegalImportCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "import.illegal";
|
||||
|
||||
/** list of illegal packages */
|
||||
/** List of illegal packages */
|
||||
private String[] illegalPkgs;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,23 +42,23 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
|||
* @author Oliver Burn
|
||||
*/
|
||||
final class ImportControlLoader extends AbstractLoader {
|
||||
/** the public ID for the configuration dtd */
|
||||
/** The public ID for the configuration dtd */
|
||||
private static final String DTD_PUBLIC_ID_1_0 =
|
||||
"-//Puppy Crawl//DTD Import Control 1.0//EN";
|
||||
|
||||
/** the public ID for the configuration dtd */
|
||||
/** The public ID for the configuration dtd */
|
||||
private static final String DTD_PUBLIC_ID_1_1 =
|
||||
"-//Puppy Crawl//DTD Import Control 1.1//EN";
|
||||
|
||||
/** the resource for the configuration dtd */
|
||||
/** The resource for the configuration dtd */
|
||||
private static final String DTD_RESOURCE_NAME_1_0 =
|
||||
"com/puppycrawl/tools/checkstyle/checks/imports/import_control_1_0.dtd";
|
||||
|
||||
/** the resource for the configuration dtd */
|
||||
/** The resource for the configuration dtd */
|
||||
private static final String DTD_RESOURCE_NAME_1_1 =
|
||||
"com/puppycrawl/tools/checkstyle/checks/imports/import_control_1_1.dtd";
|
||||
|
||||
/** the map to lookup the resource name by the id */
|
||||
/** The map to lookup the resource name by the id */
|
||||
private static final Map<String, String> DTD_RESOURCE_BY_ID = new HashMap<>();
|
||||
|
||||
/** Used to hold the {@link PkgControl} objects. */
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ public class ImportOrderCheck
|
|||
*/
|
||||
public static final String MSG_ORDERING = "import.ordering";
|
||||
|
||||
/** the special wildcard that catches all remaining groups. */
|
||||
/** The special wildcard that catches all remaining groups. */
|
||||
private static final String WILDCARD_GROUP_NAME = "*";
|
||||
|
||||
/** List of import groups specified by the user. */
|
||||
|
|
|
|||
|
|
@ -72,11 +72,11 @@ public class RedundantImportCheck
|
|||
*/
|
||||
public static final String MSG_DUPLICATE = "import.duplicate";
|
||||
|
||||
/** name of package in file */
|
||||
/** Name of package in file */
|
||||
private String pkgName;
|
||||
/** set of the imports */
|
||||
/** Set of the imports */
|
||||
private final Set<FullIdent> imports = Sets.newHashSet();
|
||||
/** set of static imports */
|
||||
/** Set of static imports */
|
||||
private final Set<FullIdent> staticImports = Sets.newHashSet();
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -59,25 +59,25 @@ public class UnusedImportsCheck extends Check {
|
|||
*/
|
||||
public static final String MSG_KEY = "import.unused";
|
||||
|
||||
/** regex to match class names. */
|
||||
/** Regex to match class names. */
|
||||
private static final Pattern CLASS_NAME = Pattern.compile(
|
||||
"((:?[\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*)");
|
||||
/** regex to match the first class name. */
|
||||
/** Regex to match the first class name. */
|
||||
private static final Pattern FIRST_CLASS_NAME = Pattern.compile(
|
||||
"^" + CLASS_NAME);
|
||||
/** regex to match argument names. */
|
||||
/** Regex to match argument names. */
|
||||
private static final Pattern ARGUMENT_NAME = Pattern.compile(
|
||||
"[(,]\\s*" + CLASS_NAME.pattern());
|
||||
|
||||
/** flag to indicate when time to start collecting references. */
|
||||
/** Flag to indicate when time to start collecting references. */
|
||||
private boolean collect;
|
||||
/** flag whether to process Javdoc comments. */
|
||||
/** Flag whether to process Javdoc comments. */
|
||||
private boolean processingJavadoc;
|
||||
|
||||
/** set of the imports. */
|
||||
/** Set of the imports. */
|
||||
private final Set<FullIdent> imports = Sets.newHashSet();
|
||||
|
||||
/** set of references - possibly to imports or other things. */
|
||||
/** Set of references - possibly to imports or other things. */
|
||||
private final Set<String> referenced = Sets.newHashSet();
|
||||
|
||||
public void setProcessJavadoc(boolean value) {
|
||||
|
|
|
|||
|
|
@ -61,16 +61,16 @@ public abstract class AbstractExpressionHandler {
|
|||
*/
|
||||
private final IndentationCheck indentCheck;
|
||||
|
||||
/** the AST which is handled by this handler */
|
||||
/** The AST which is handled by this handler */
|
||||
private final DetailAST mainAst;
|
||||
|
||||
/** name used during output to user */
|
||||
/** Name used during output to user */
|
||||
private final String typeName;
|
||||
|
||||
/** containing AST handler */
|
||||
/** Containing AST handler */
|
||||
private final AbstractExpressionHandler parent;
|
||||
|
||||
/** indentation amount for this handler */
|
||||
/** Indentation amount for this handler */
|
||||
private IndentLevel level;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class HandlerFactory {
|
|||
private final Map<Integer, Constructor<?>> typeHandlers =
|
||||
Maps.newHashMap();
|
||||
|
||||
/** cache for created method call handlers */
|
||||
/** Cache for created method call handlers */
|
||||
private final Map<DetailAST, AbstractExpressionHandler> createdHandlers =
|
||||
Maps.newHashMap();
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import java.util.BitSet;
|
|||
* @author o_sukhodolsky
|
||||
*/
|
||||
public class IndentLevel {
|
||||
/** set of acceptable indentation levels. */
|
||||
/** Set of acceptable indentation levels. */
|
||||
private final BitSet levels = new BitSet();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -83,22 +83,22 @@ public class IndentationCheck extends Check {
|
|||
/** Default indentation amount - based on Sun */
|
||||
private static final int DEFAULT_INDENTATION = 4;
|
||||
|
||||
/** how many tabs or spaces to use */
|
||||
/** How many tabs or spaces to use */
|
||||
private int basicOffset = DEFAULT_INDENTATION;
|
||||
|
||||
/** how much to indent a case label */
|
||||
/** How much to indent a case label */
|
||||
private int caseIndentationAmount = DEFAULT_INDENTATION;
|
||||
|
||||
/** how far brace should be indented when on next line */
|
||||
/** How far brace should be indented when on next line */
|
||||
private int braceAdjustment;
|
||||
|
||||
/** how far throws should be indented when on next line */
|
||||
/** How far throws should be indented when on next line */
|
||||
private int throwsIndentationAmount = DEFAULT_INDENTATION;
|
||||
|
||||
/** how much to indent an array initialization when on next line */
|
||||
/** How much to indent an array initialization when on next line */
|
||||
private int arrayInitIndentationAmount = DEFAULT_INDENTATION;
|
||||
|
||||
/** how far continuation line should be indented when line-wrapping is present */
|
||||
/** How far continuation line should be indented when line-wrapping is present */
|
||||
private int lineWrappingIndentation = DEFAULT_INDENTATION;
|
||||
|
||||
/**
|
||||
|
|
@ -108,10 +108,10 @@ public class IndentationCheck extends Check {
|
|||
*/
|
||||
private boolean forceStrictCondition;
|
||||
|
||||
/** handlers currently in use */
|
||||
/** Handlers currently in use */
|
||||
private final Deque<AbstractExpressionHandler> handlers = new ArrayDeque<>();
|
||||
|
||||
/** factory from which handlers are distributed */
|
||||
/** Factory from which handlers are distributed */
|
||||
private final HandlerFactory handlerFactory = new HandlerFactory();
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ class HtmlTag {
|
|||
/** The comment line of text where this tag appears. */
|
||||
private final String text;
|
||||
|
||||
/** if this tag is self-closed. */
|
||||
/** If this tag is self-closed. */
|
||||
private final boolean closedTag;
|
||||
|
||||
/** if the tag is incomplete. */
|
||||
/** If the tag is incomplete. */
|
||||
private final boolean incomplete;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -100,15 +100,15 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck {
|
|||
*/
|
||||
public static final String MSG_DUPLICATE_TAG = "javadoc.duplicateTag";
|
||||
|
||||
/** compiled regexp to match Javadoc tags that take an argument * */
|
||||
/** Compiled regexp to match Javadoc tags that take an argument * */
|
||||
private static final Pattern MATCH_JAVADOC_ARG =
|
||||
Utils.createPattern("@(throws|exception|param)\\s+(\\S+)\\s+\\S*");
|
||||
|
||||
/** compiled regexp to match first part of multilineJavadoc tags * */
|
||||
/** Compiled regexp to match first part of multilineJavadoc tags * */
|
||||
private static final Pattern MATCH_JAVADOC_ARG_MULTILINE_START =
|
||||
Utils.createPattern("@(throws|exception|param)\\s+(\\S+)\\s*$");
|
||||
|
||||
/** compiled regexp to look for a continuation of the comment * */
|
||||
/** Compiled regexp to look for a continuation of the comment * */
|
||||
private static final Pattern MATCH_JAVADOC_MULTILINE_CONT =
|
||||
Utils.createPattern("(\\*/|@|[^\\s\\*])");
|
||||
|
||||
|
|
@ -117,23 +117,23 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck {
|
|||
/** Multiline finished at next Javadoc * */
|
||||
private static final String NEXT_TAG = "@";
|
||||
|
||||
/** compiled regexp to match Javadoc tags with no argument * */
|
||||
/** Compiled regexp to match Javadoc tags with no argument * */
|
||||
private static final Pattern MATCH_JAVADOC_NOARG =
|
||||
Utils.createPattern("@(return|see)\\s+\\S");
|
||||
/** compiled regexp to match first part of multilineJavadoc tags * */
|
||||
/** Compiled regexp to match first part of multilineJavadoc tags * */
|
||||
private static final Pattern MATCH_JAVADOC_NOARG_MULTILINE_START =
|
||||
Utils.createPattern("@(return|see)\\s*$");
|
||||
/** compiled regexp to match Javadoc tags with no argument and {} * */
|
||||
/** Compiled regexp to match Javadoc tags with no argument and {} * */
|
||||
private static final Pattern MATCH_JAVADOC_NOARG_CURLY =
|
||||
Utils.createPattern("\\{\\s*@(inheritDoc)\\s*\\}");
|
||||
|
||||
/** Default value of minimal amount of lines in method to demand documentation presence.*/
|
||||
private static final int DEFAULT_MIN_LINE_COUNT = -1;
|
||||
|
||||
/** the visibility scope where Javadoc comments are checked * */
|
||||
/** The visibility scope where Javadoc comments are checked * */
|
||||
private Scope scope = Scope.PRIVATE;
|
||||
|
||||
/** the visibility scope where Javadoc comments shouldn't be checked * */
|
||||
/** The visibility scope where Javadoc comments shouldn't be checked * */
|
||||
private Scope excludeScope;
|
||||
|
||||
/** Minimal amount of lines in method to demand documentation presence.*/
|
||||
|
|
@ -921,9 +921,9 @@ public class JavadocMethodCheck extends AbstractTypeAwareCheck {
|
|||
|
||||
/** Stores useful information about declared exception. */
|
||||
private static class ExceptionInfo {
|
||||
/** does the exception have throws tag associated with. */
|
||||
/** Does the exception have throws tag associated with. */
|
||||
private boolean found;
|
||||
/** class information associated with this exception. */
|
||||
/** Class information associated with this exception. */
|
||||
private final AbstractClassInfo classInfo;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public class JavadocStyleCheck
|
|||
/** The scope to check. */
|
||||
private Scope scope = Scope.PRIVATE;
|
||||
|
||||
/** the visibility scope where Javadoc comments shouldn't be checked **/
|
||||
/** The visibility scope where Javadoc comments shouldn't be checked **/
|
||||
private Scope excludeScope;
|
||||
|
||||
/** Format for matching the end of a sentence. */
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTagInfo;
|
|||
* @author Oliver Burn
|
||||
*/
|
||||
public class JavadocTag {
|
||||
/** the line number of the tag **/
|
||||
/** The line number of the tag **/
|
||||
private final int lineNo;
|
||||
/** the column number of the tag **/
|
||||
/** The column number of the tag **/
|
||||
private final int columnNo;
|
||||
/** an optional first argument. For example the parameter name. **/
|
||||
/** An optional first argument. For example the parameter name. **/
|
||||
private final String firstArg;
|
||||
/** the JavadocTagInfo representing this tag **/
|
||||
/** The JavadocTagInfo representing this tag **/
|
||||
private final JavadocTagInfo tagInfo;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -82,24 +82,24 @@ public class JavadocTypeCheck
|
|||
*/
|
||||
public static final String UNUSED_TAG_GENERAL = "javadoc.unusedTagGeneral";
|
||||
|
||||
/** the scope to check for */
|
||||
/** The scope to check for */
|
||||
private Scope scope = Scope.PRIVATE;
|
||||
/** the visibility scope where Javadoc comments shouldn't be checked **/
|
||||
/** The visibility scope where Javadoc comments shouldn't be checked **/
|
||||
private Scope excludeScope;
|
||||
/** compiled regexp to match author tag content **/
|
||||
/** Compiled regexp to match author tag content **/
|
||||
private Pattern authorFormatPattern;
|
||||
/** compiled regexp to match version tag content **/
|
||||
/** Compiled regexp to match version tag content **/
|
||||
private Pattern versionFormatPattern;
|
||||
/** regexp to match author tag content */
|
||||
/** Regexp to match author tag content */
|
||||
private String authorFormat;
|
||||
/** regexp to match version tag content */
|
||||
/** Regexp to match version tag content */
|
||||
private String versionFormat;
|
||||
/**
|
||||
* controls whether to ignore errors when a method has type parameters but
|
||||
* does not have matching param tags in the javadoc. Defaults to false.
|
||||
*/
|
||||
private boolean allowMissingParamTags;
|
||||
/** controls whether to flag errors for unknown tags. Defaults to false. */
|
||||
/** Controls whether to flag errors for unknown tags. Defaults to false. */
|
||||
private boolean allowUnknownTags;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ import com.puppycrawl.tools.checkstyle.api.TextBlock;
|
|||
* @author Lyle Hanson
|
||||
*/
|
||||
public final class JavadocUtils {
|
||||
/** maps from a token name to value */
|
||||
/** Maps from a token name to value */
|
||||
private static final ImmutableMap<String, Integer> TOKEN_NAME_TO_VALUE;
|
||||
/** maps from a token value to name */
|
||||
/** Maps from a token value to name */
|
||||
private static final String[] TOKEN_VALUE_TO_NAME;
|
||||
|
||||
// Using reflection gets all token names and values from JavadocTokenTypes class
|
||||
|
|
@ -84,7 +84,7 @@ public final class JavadocUtils {
|
|||
TOKEN_VALUE_TO_NAME = tempTokenValueToName;
|
||||
}
|
||||
|
||||
/** prevent instantiation */
|
||||
/** Prevent instantiation */
|
||||
private JavadocUtils() {
|
||||
}
|
||||
|
||||
|
|
@ -171,11 +171,11 @@ public final class JavadocUtils {
|
|||
* The type of Javadoc tag we want returned.
|
||||
*/
|
||||
public enum JavadocTagType {
|
||||
/** block type. */
|
||||
/** Block type. */
|
||||
BLOCK,
|
||||
/** inline type. */
|
||||
/** Inline type. */
|
||||
INLINE,
|
||||
/** all validTags. */
|
||||
/** All validTags. */
|
||||
ALL
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,13 +44,13 @@ public class JavadocVariableCheck
|
|||
*/
|
||||
public static final String JAVADOC_MISSING = "javadoc.missing";
|
||||
|
||||
/** the scope to check */
|
||||
/** The scope to check */
|
||||
private Scope scope = Scope.PRIVATE;
|
||||
|
||||
/** the visibility scope where Javadoc comments shouldn't be checked **/
|
||||
/** The visibility scope where Javadoc comments shouldn't be checked **/
|
||||
private Scope excludeScope;
|
||||
|
||||
/** the pattern to ignore variable name */
|
||||
/** The pattern to ignore variable name */
|
||||
private Pattern ignoreNamePattern;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class SingleLineJavadocCheck extends AbstractJavadocCheck {
|
|||
*/
|
||||
private List<String> ignoredTags = new ArrayList<>();
|
||||
|
||||
/** whether inline tags must be ignored **/
|
||||
/** Whether inline tags must be ignored **/
|
||||
private boolean ignoreInlineTags = true;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -267,9 +267,9 @@ class TagParser {
|
|||
* @author o_sukholsky
|
||||
*/
|
||||
private static final class Point {
|
||||
/** line number. */
|
||||
/** Line number. */
|
||||
private final int line;
|
||||
/** column number.*/
|
||||
/** Column number.*/
|
||||
private final int column;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -86,16 +86,16 @@ public class WriteTagCheck
|
|||
*/
|
||||
public static final String TAG_FORMAT = "type.tagFormat";
|
||||
|
||||
/** compiled regexp to match tag **/
|
||||
/** Compiled regexp to match tag **/
|
||||
private Pattern tagRE;
|
||||
/** compiled regexp to match tag content **/
|
||||
/** Compiled regexp to match tag content **/
|
||||
private Pattern tagFormatRE;
|
||||
|
||||
/** regexp to match tag */
|
||||
/** Regexp to match tag */
|
||||
private String tag;
|
||||
/** regexp to match tag content */
|
||||
/** Regexp to match tag content */
|
||||
private String tagFormat;
|
||||
/** the severity level of found tag reports */
|
||||
/** The severity level of found tag reports */
|
||||
private SeverityLevel tagSeverityLevel = SeverityLevel.INFO;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public abstract class AbstractClassCouplingCheck extends Check {
|
|||
private Set<String> excludedClasses = DEFAULT_EXCLUDED_CLASSES;
|
||||
/** Allowed complexity. */
|
||||
private int max;
|
||||
/** package of the file we check. */
|
||||
/** Package of the file we check. */
|
||||
private String packageName;
|
||||
|
||||
/** Stack of contexts. */
|
||||
|
|
|
|||
|
|
@ -35,16 +35,16 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
|
|||
*/
|
||||
public abstract class AbstractComplexityCheck
|
||||
extends Check {
|
||||
/** the initial current value */
|
||||
/** The initial current value */
|
||||
private static final BigInteger INITIAL_VALUE = BigInteger.ONE;
|
||||
|
||||
/** stack of values - all but the current value */
|
||||
/** Stack of values - all but the current value */
|
||||
private final Deque<BigInteger> valueStack = new ArrayDeque<>();
|
||||
|
||||
/** the current value */
|
||||
/** The current value */
|
||||
private BigInteger currentValue = BigInteger.ZERO;
|
||||
|
||||
/** threshold to report error for */
|
||||
/** Threshold to report error for */
|
||||
private int max;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public final class ClassFanOutComplexityCheck extends AbstractClassCouplingCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "classFanOutComplexity";
|
||||
|
||||
/** default value of max value. */
|
||||
/** Default value of max value. */
|
||||
private static final int DEFAULT_MAX = 20;
|
||||
|
||||
/** Creates new instance of this check. */
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class CyclomaticComplexityCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "cyclomaticComplexity";
|
||||
|
||||
/** default allowed complexity */
|
||||
/** Default allowed complexity */
|
||||
private static final int DEFAULT_VALUE = 10;
|
||||
|
||||
/** Create an instance. */
|
||||
|
|
|
|||
|
|
@ -58,25 +58,25 @@ public class JavaNCSSCheck extends Check {
|
|||
*/
|
||||
public static final String MSG_FILE = "ncss.file";
|
||||
|
||||
/** default constant for max file ncss */
|
||||
/** Default constant for max file ncss */
|
||||
private static final int FILE_MAX_NCSS = 2000;
|
||||
|
||||
/** default constant for max file ncss */
|
||||
/** Default constant for max file ncss */
|
||||
private static final int CLASS_MAX_NCSS = 1500;
|
||||
|
||||
/** default constant for max method ncss */
|
||||
/** Default constant for max method ncss */
|
||||
private static final int METHOD_MAX_NCSS = 50;
|
||||
|
||||
/** maximum ncss for a complete source file */
|
||||
/** Maximum ncss for a complete source file */
|
||||
private int fileMaximum = FILE_MAX_NCSS;
|
||||
|
||||
/** maximum ncss for a class */
|
||||
/** Maximum ncss for a class */
|
||||
private int classMaximum = CLASS_MAX_NCSS;
|
||||
|
||||
/** maximum ncss for a method */
|
||||
/** Maximum ncss for a method */
|
||||
private int methodMaximum = METHOD_MAX_NCSS;
|
||||
|
||||
/** list containing the stacked counters */
|
||||
/** List containing the stacked counters */
|
||||
private Deque<Counter> counters;
|
||||
|
||||
@Override
|
||||
|
|
@ -371,7 +371,7 @@ public class JavaNCSSCheck extends Check {
|
|||
* Class representing a counter,
|
||||
*/
|
||||
private static class Counter {
|
||||
/** the counters internal integer */
|
||||
/** The counters internal integer */
|
||||
private int ivCount;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ public final class AbstractClassNameCheck extends AbstractFormatCheck {
|
|||
/** Default format for abstract class names */
|
||||
private static final String DEFAULT_FORMAT = "^Abstract.+$";
|
||||
|
||||
/** whether to ignore checking the modifier */
|
||||
/** Whether to ignore checking the modifier */
|
||||
private boolean ignoreModifier;
|
||||
|
||||
/** whether to ignore checking the name */
|
||||
/** Whether to ignore checking the name */
|
||||
private boolean ignoreName;
|
||||
|
||||
/** Creates new instance of the check. */
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ public class RegexpCheck extends AbstractFormatCheck {
|
|||
findMatch();
|
||||
}
|
||||
|
||||
/** recursive method that finds the matches. */
|
||||
/** Recursive method that finds the matches. */
|
||||
private void findMatch() {
|
||||
|
||||
final boolean foundMatch = matcher.find();
|
||||
|
|
|
|||
|
|
@ -64,10 +64,10 @@ public class AnonInnerLengthCheck extends Check {
|
|||
*/
|
||||
public static final String MSG_KEY = "maxLen.anonInner";
|
||||
|
||||
/** default maximum number of lines */
|
||||
/** Default maximum number of lines */
|
||||
private static final int DEFAULT_MAX = 20;
|
||||
|
||||
/** maximum number of lines */
|
||||
/** Maximum number of lines */
|
||||
private int max = DEFAULT_MAX;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ public final class ExecutableStatementCountCheck
|
|||
*/
|
||||
public static final String MSG_KEY = "executableStatementCount";
|
||||
|
||||
/** default threshold */
|
||||
/** Default threshold */
|
||||
private static final int DEFAULT_MAX = 30;
|
||||
|
||||
/** threshold to report error for */
|
||||
/** Threshold to report error for */
|
||||
private int max;
|
||||
|
||||
/** Stack of method contexts. */
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue