From: Evgeny Mandrikov Date: Tue, 6 Nov 2012 15:37:27 +0000 (+0100) Subject: SONAR-3934 Extract sonar-checkstyle-plugin into Sonar Java X-Git-Tag: 3.4~383 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a13142773b3cf011c5e39254e45e8cbcdbebe16a;p=sonarqube.git SONAR-3934 Extract sonar-checkstyle-plugin into Sonar Java --- diff --git a/plugins/sonar-checkstyle-plugin/infinitest.args b/plugins/sonar-checkstyle-plugin/infinitest.args deleted file mode 100644 index ed9f41dadc7..00000000000 --- a/plugins/sonar-checkstyle-plugin/infinitest.args +++ /dev/null @@ -1 +0,0 @@ --Djava.awt.headless=true \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/pom.xml b/plugins/sonar-checkstyle-plugin/pom.xml deleted file mode 100644 index 2a87a0c35c3..00000000000 --- a/plugins/sonar-checkstyle-plugin/pom.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - 4.0.0 - - org.codehaus.sonar - sonar - 3.4-SNAPSHOT - ../.. - - org.codehaus.sonar.plugins - sonar-checkstyle-plugin - sonar-plugin - Sonar :: Plugins :: Checkstyle - Checkstyle is a code analyser to help programmers write Java code that adheres to a coding standard. - - - - 5.6 - - - - - org.codehaus.sonar - sonar-plugin-api - provided - - - com.puppycrawl.tools - checkstyle - ${checkstyle.version} - - - commons-logging - commons-logging - - - com.google.collections - google-collections - - - commons-lang - commons-lang - - - commons-collections - commons-collections - - - commons-cli - commons-cli - - - - commons-beanutils - commons-beanutils-core - - - - com.sun - tools - - - - - - - org.apache.maven - maven-project - test - - - - org.codehaus.sonar - sonar-testing-harness - test - - - - - - - src/main/resources - true - - - - - ${basedir}/src/main/resources - - - ${basedir}/src/test/resources - - - - - org.codehaus.sonar - sonar-packaging-maven-plugin - - checkstyle - Checkstyle - org.sonar.plugins.checkstyle.CheckstylePlugin - - Checkstyle ${checkstyle.version}.]]> - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-plugin-size - - enforce - - verify - - - - 1100000 - 1000000 - - ${project.build.directory}/${project.build.finalName}.jar - - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - methods - 3 - true - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleAuditListener.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleAuditListener.java deleted file mode 100644 index e5678dd828a..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleAuditListener.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import com.google.common.annotations.VisibleForTesting; -import com.puppycrawl.tools.checkstyle.api.AuditEvent; -import com.puppycrawl.tools.checkstyle.api.AuditListener; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.sonar.api.BatchExtension; -import org.sonar.api.batch.SensorContext; -import org.sonar.api.resources.JavaFile; -import org.sonar.api.resources.Project; -import org.sonar.api.resources.Resource; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleFinder; -import org.sonar.api.rules.Violation; - -/** - * @since 2.3 - */ -public class CheckstyleAuditListener implements AuditListener, BatchExtension { - - private static final Logger LOG = LoggerFactory.getLogger(CheckstyleAuditListener.class); - - private final SensorContext context; - private final Project project; - private final RuleFinder ruleFinder; - private Resource currentResource = null; - - public CheckstyleAuditListener(SensorContext context, Project project, RuleFinder ruleFinder) { - this.context = context; - this.project = project; - this.ruleFinder = ruleFinder; - } - - public void auditStarted(AuditEvent event) { - // nop - } - - public void auditFinished(AuditEvent event) { - // nop - } - - public void fileStarted(AuditEvent event) { - // nop - } - - public void fileFinished(AuditEvent event) { - currentResource = null; - } - - public void addError(AuditEvent event) { - String ruleKey = getRuleKey(event); - if (ruleKey != null) { - String message = getMessage(event); - // In Checkstyle 5.5 exceptions are reported as an events from TreeWalker - if ("com.puppycrawl.tools.checkstyle.TreeWalker".equals(ruleKey)) { - LOG.warn(message); - } - Rule rule = ruleFinder.findByKey(CheckstyleConstants.REPOSITORY_KEY, ruleKey); - if (rule != null) { - initResource(event); - Violation violation = Violation.create(rule, currentResource) - .setLineId(getLineId(event)) - .setMessage(message); - context.saveViolation(violation); - } - } - } - - private void initResource(AuditEvent event) { - if (currentResource == null) { - String absoluteFilename = event.getFileName(); - currentResource = JavaFile.fromAbsolutePath(absoluteFilename, project.getFileSystem().getSourceDirs(), false); - } - } - - @VisibleForTesting - static String getRuleKey(AuditEvent event) { - String key = null; - try { - key = event.getModuleId(); - } catch (Exception e) { - // checkstyle throws a NullPointerException if the message is not set - } - if (StringUtils.isBlank(key)) { - try { - key = event.getSourceName(); - } catch (Exception e) { - // checkstyle can throw a NullPointerException if the message is not set - } - } - return key; - } - - @VisibleForTesting - static String getMessage(AuditEvent event) { - try { - return event.getMessage(); - - } catch (Exception e) { - // checkstyle can throw a NullPointerException if the message is not set - return null; - } - } - - @VisibleForTesting - static Integer getLineId(AuditEvent event) { - try { - int line = event.getLine(); - // checkstyle returns 0 if there is no relation to a file content, but we use null - return line == 0 ? null : line; - - } catch (Exception e) { - // checkstyle can throw a NullPointerException if the message is not set - return null; - } - } - - /** - * Note that this method never invoked from Checkstyle 5.5. - */ - public void addException(AuditEvent event, Throwable throwable) { - // nop - } - - Resource getCurrentResource() { - return currentResource; - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleConfiguration.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleConfiguration.java deleted file mode 100644 index 550c7e4b1f4..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleConfiguration.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import com.puppycrawl.tools.checkstyle.ConfigurationLoader; -import com.puppycrawl.tools.checkstyle.DefaultConfiguration; -import com.puppycrawl.tools.checkstyle.PropertiesExpander; -import com.puppycrawl.tools.checkstyle.api.CheckstyleException; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.CharEncoding; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.sonar.api.BatchExtension; -import org.sonar.api.CoreProperties; -import org.sonar.api.Property; -import org.sonar.api.config.Settings; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.resources.InputFileUtils; -import org.sonar.api.resources.Java; -import org.sonar.api.resources.ProjectFileSystem; -import org.sonar.api.utils.SonarException; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.nio.charset.Charset; -import java.util.List; -import java.util.Locale; -import java.util.Properties; - -@org.sonar.api.Properties({ - @Property( - key = CheckstyleConfiguration.PROPERTY_GENERATE_XML, - defaultValue = "false", - name = "Generate XML Report", - project = false, global = false - ) -}) -public class CheckstyleConfiguration implements BatchExtension { - - private static final Logger LOG = LoggerFactory.getLogger(CheckstyleConfiguration.class); - public static final String PROPERTY_GENERATE_XML = "sonar.checkstyle.generateXml"; - - private final CheckstyleProfileExporter confExporter; - private final RulesProfile profile; - private final Settings conf; - private final ProjectFileSystem fileSystem; - - public CheckstyleConfiguration(Settings conf, CheckstyleProfileExporter confExporter, RulesProfile profile, ProjectFileSystem fileSystem) { - this.conf = conf; - this.confExporter = confExporter; - this.profile = profile; - this.fileSystem = fileSystem; - } - - public File getXMLDefinitionFile() { - Writer writer = null; - File xmlFile = new File(fileSystem.getSonarWorkingDirectory(), "checkstyle.xml"); - try { - writer = new OutputStreamWriter(new FileOutputStream(xmlFile, false), CharEncoding.UTF_8); - confExporter.exportProfile(profile, writer); - writer.flush(); - return xmlFile; - - } catch (IOException e) { - throw new SonarException("Fail to save the Checkstyle configuration to " + xmlFile.getPath(), e); - - } finally { - IOUtils.closeQuietly(writer); - } - } - - public List getSourceFiles() { - return InputFileUtils.toFiles(fileSystem.mainFiles(Java.KEY)); - } - - public File getTargetXMLReport() { - if (conf.getBoolean(PROPERTY_GENERATE_XML)) { - return new File(fileSystem.getSonarWorkingDirectory(), "checkstyle-result.xml"); - } - return null; - } - - public com.puppycrawl.tools.checkstyle.api.Configuration getCheckstyleConfiguration() throws CheckstyleException { - File xmlConfig = getXMLDefinitionFile(); - - LOG.info("Checkstyle configuration: " + xmlConfig.getAbsolutePath()); - com.puppycrawl.tools.checkstyle.api.Configuration configuration = toCheckstyleConfiguration(xmlConfig); - defineCharset(configuration); - return configuration; - } - - static com.puppycrawl.tools.checkstyle.api.Configuration toCheckstyleConfiguration(File xmlConfig) throws CheckstyleException { - return ConfigurationLoader.loadConfiguration(xmlConfig.getAbsolutePath(), new PropertiesExpander(new Properties())); - } - - private void defineCharset(com.puppycrawl.tools.checkstyle.api.Configuration configuration) { - com.puppycrawl.tools.checkstyle.api.Configuration[] modules = configuration.getChildren(); - for (com.puppycrawl.tools.checkstyle.api.Configuration module : modules) { - if (("Checker".equals(module.getName()) || "com.puppycrawl.tools.checkstyle.Checker".equals(module.getName())) && (module instanceof DefaultConfiguration)) { - Charset charset = getCharset(); - LOG.info("Checkstyle charset: " + charset.name()); - ((DefaultConfiguration) module).addAttribute("charset", charset.name()); - } - } - } - - public Locale getLocale() { - return new Locale(conf.getString(CoreProperties.CORE_VIOLATION_LOCALE_PROPERTY)); - } - - public Charset getCharset() { - Charset charset = fileSystem.getSourceCharset(); - if (charset == null) { - charset = Charset.forName(System.getProperty("file.encoding", CharEncoding.UTF_8)); - } - return charset; - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleConstants.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleConstants.java deleted file mode 100644 index cc07c021425..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleConstants.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.sonar.api.CoreProperties; - -public final class CheckstyleConstants { - - public static final String REPOSITORY_KEY = CoreProperties.CHECKSTYLE_PLUGIN; - public static final String REPOSITORY_NAME = "Checkstyle"; - public static final String PLUGIN_NAME = "Checkstyle"; - - public static final String FILTERS_KEY = "sonar.checkstyle.filters"; - - public static final String FILTERS_DEFAULT_VALUE = ""; - - private CheckstyleConstants() { - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleExecutor.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleExecutor.java deleted file mode 100644 index 8b068a343e0..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleExecutor.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import java.io.File; -import java.io.OutputStream; -import java.util.Locale; - -import com.puppycrawl.tools.checkstyle.Checker; -import com.puppycrawl.tools.checkstyle.PackageNamesLoader; -import com.puppycrawl.tools.checkstyle.XMLLogger; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.sonar.api.BatchExtension; -import org.sonar.api.batch.ProjectClasspath; -import org.sonar.api.utils.SonarException; -import org.sonar.api.utils.TimeProfiler; - -public class CheckstyleExecutor implements BatchExtension { - private static final Logger LOG = LoggerFactory.getLogger(CheckstyleExecutor.class); - - private CheckstyleConfiguration configuration; - private ClassLoader projectClassloader; - private CheckstyleAuditListener listener; - - public CheckstyleExecutor(CheckstyleConfiguration configuration, CheckstyleAuditListener listener, ProjectClasspath classpath) { - this.configuration = configuration; - this.listener = listener; - this.projectClassloader = classpath.getClassloader(); - } - - CheckstyleExecutor(CheckstyleConfiguration configuration, CheckstyleAuditListener listener, ClassLoader projectClassloader) { - this.configuration = configuration; - this.listener = listener; - this.projectClassloader = projectClassloader; - } - - /** - * Execute Checkstyle and return the generated XML report. - */ - public void execute() { - TimeProfiler profiler = new TimeProfiler().start("Execute Checkstyle " + CheckstyleVersion.getVersion()); - ClassLoader initialClassLoader = Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader(PackageNamesLoader.class.getClassLoader()); - - Checker checker = null; - OutputStream xmlOutput = null; - try { - - checker = new Checker(); - checker.setClassloader(projectClassloader); - checker.setModuleClassLoader(Thread.currentThread().getContextClassLoader()); - checker.addListener(listener); - - File xmlReport = configuration.getTargetXMLReport(); - if (xmlReport != null) { - LOG.info("Checkstyle output report: " + xmlReport.getAbsolutePath()); - xmlOutput = FileUtils.openOutputStream(xmlReport); - checker.addListener(new XMLLogger(xmlOutput, true)); - } - - checker.setCharset(configuration.getCharset().name()); - configureLocale(checker); - checker.configure(configuration.getCheckstyleConfiguration()); - checker.process(configuration.getSourceFiles()); - - profiler.stop(); - - } catch (Exception e) { - throw new SonarException("Can not execute Checkstyle", e); - - } finally { - if (checker != null) { - checker.destroy(); - } - IOUtils.closeQuietly(xmlOutput); - Thread.currentThread().setContextClassLoader(initialClassLoader); - } - } - - private void configureLocale(Checker checker) { - Locale locale = configuration.getLocale(); - checker.setLocaleLanguage(locale.getLanguage()); - checker.setLocaleCountry(locale.getCountry()); - } - -} \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstylePlugin.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstylePlugin.java deleted file mode 100644 index b81a8454578..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstylePlugin.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import com.google.common.collect.ImmutableList; -import org.sonar.api.Extension; -import org.sonar.api.Properties; -import org.sonar.api.Property; -import org.sonar.api.PropertyType; -import org.sonar.api.SonarPlugin; - -import java.util.List; - -@Properties({ - @Property(key = CheckstyleConstants.FILTERS_KEY, - defaultValue = CheckstyleConstants.FILTERS_DEFAULT_VALUE, - name = "Filters", - description = "Checkstyle support three error filtering mechanisms : SuppressionCommentFilter, SuppressWithNearbyCommentFilter and SuppressionFilter." - + "This property allows to configure all those filters with a native XML format." - + " See Checkstyle configuration page to get more information on those filters.", - project = false, - global = true, - type = PropertyType.TEXT)}) -public final class CheckstylePlugin extends SonarPlugin { - - public List> getExtensions() { - return ImmutableList.of( - CheckstyleSensor.class, - CheckstyleConfiguration.class, - CheckstyleExecutor.class, - CheckstyleAuditListener.class, - CheckstyleProfileExporter.class, - CheckstyleProfileImporter.class, - CheckstyleRuleRepository.class, - SonarWayProfile.class, - SunConventionsProfile.class, - SonarWayWithFindbugsProfile.class); - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporter.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporter.java deleted file mode 100644 index 700f622bb56..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporter.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; -import org.apache.commons.configuration.BaseConfiguration; -import org.apache.commons.configuration.Configuration; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; -import org.sonar.api.profiles.ProfileExporter; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.resources.Java; -import org.sonar.api.rules.ActiveRule; -import org.sonar.api.rules.RuleParam; -import org.sonar.api.utils.SonarException; - -import java.io.IOException; -import java.io.Writer; -import java.util.List; - -public class CheckstyleProfileExporter extends ProfileExporter { - - static final String DOCTYPE_DECLARATION = ""; - private Configuration conf; - - public CheckstyleProfileExporter(Configuration conf) { - super(CheckstyleConstants.REPOSITORY_KEY, CheckstyleConstants.PLUGIN_NAME); - this.conf = conf; - setSupportedLanguages(Java.KEY); - setMimeType("application/xml"); - } - - /** - * for unit tests - */ - CheckstyleProfileExporter() { - this(new BaseConfiguration()); - } - - @Override - public void exportProfile(RulesProfile profile, Writer writer) { - try { - ListMultimap activeRulesByConfigKey = arrangeByConfigKey(profile.getActiveRulesByRepository(CheckstyleConstants.REPOSITORY_KEY)); - generateXML(writer, activeRulesByConfigKey); - - } catch (IOException e) { - throw new SonarException("Fail to export the profile " + profile, e); - } - - } - - private void generateXML(Writer writer, ListMultimap activeRulesByConfigKey) throws IOException { - appendXmlHeader(writer); - appendCustomFilters(writer); - appendCheckerModules(writer, activeRulesByConfigKey); - appendTreeWalker(writer, activeRulesByConfigKey); - appendXmlFooter(writer); - } - - private void appendXmlHeader(Writer writer) throws IOException { - writer.append("" - + DOCTYPE_DECLARATION - + "" - + ""); - } - - private void appendCustomFilters(Writer writer) throws IOException { - String filtersXML = conf.getString(CheckstyleConstants.FILTERS_KEY, CheckstyleConstants.FILTERS_DEFAULT_VALUE); - if (StringUtils.isNotBlank(filtersXML)) { - writer.append(filtersXML); - } - } - - private void appendCheckerModules(Writer writer, ListMultimap activeRulesByConfigKey) throws IOException { - for (String configKey : activeRulesByConfigKey.keySet()) { - if (!isInTreeWalker(configKey)) { - List activeRules = activeRulesByConfigKey.get(configKey); - for (ActiveRule activeRule : activeRules) { - appendModule(writer, activeRule); - } - } - } - } - - private void appendTreeWalker(Writer writer, ListMultimap activeRulesByConfigKey) throws IOException { - writer.append(""); - writer.append(" "); - for (String configKey : activeRulesByConfigKey.keySet()) { - if (isInTreeWalker(configKey)) { - List activeRules = activeRulesByConfigKey.get(configKey); - for (ActiveRule activeRule : activeRules) { - appendModule(writer, activeRule); - } - } - } - writer.append(""); - } - - private void appendXmlFooter(Writer writer) throws IOException { - writer.append(""); - } - - static boolean isInTreeWalker(String configKey) { - return StringUtils.startsWithIgnoreCase(configKey, "Checker/TreeWalker/"); - } - - private static ListMultimap arrangeByConfigKey(List activeRules) { - ListMultimap result = ArrayListMultimap.create(); - if (activeRules != null) { - for (ActiveRule activeRule : activeRules) { - result.put(activeRule.getConfigKey(), activeRule); - } - } - return result; - } - - private void appendModule(Writer writer, ActiveRule activeRule) throws IOException { - String moduleName = StringUtils.substringAfterLast(activeRule.getConfigKey(), "/"); - writer.append(""); - if (activeRule.getRule().getParent() != null) { - appendModuleProperty(writer, "id", activeRule.getRuleKey()); - } - appendModuleProperty(writer, "severity", CheckstyleSeverityUtils.toSeverity(activeRule.getSeverity())); - appendRuleParameters(writer, activeRule); - writer.append(""); - } - - private void appendRuleParameters(Writer writer, ActiveRule activeRule) throws IOException { - for (RuleParam ruleParam : activeRule.getRule().getParams()) { - String value = activeRule.getParameter(ruleParam.getKey()); - if (StringUtils.isNotBlank(value)) { - appendModuleProperty(writer, ruleParam.getKey(), value); - } - } - } - - private void appendModuleProperty(Writer writer, String propertyKey, String propertyValue) throws IOException { - if (StringUtils.isNotBlank(propertyValue)) { - writer.append(""); - } - } - -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileImporter.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileImporter.java deleted file mode 100644 index 25b8f5520bb..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileImporter.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import com.google.common.collect.Maps; -import org.apache.commons.lang.StringUtils; -import org.codehaus.staxmate.SMInputFactory; -import org.codehaus.staxmate.in.SMHierarchicCursor; -import org.codehaus.staxmate.in.SMInputCursor; -import org.sonar.api.profiles.ProfileImporter; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.resources.Java; -import org.sonar.api.rules.ActiveRule; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleFinder; -import org.sonar.api.rules.RuleQuery; -import org.sonar.api.utils.ValidationMessages; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; - -import java.io.Reader; -import java.util.Map; - -public class CheckstyleProfileImporter extends ProfileImporter { - - private static final String CHECKER_MODULE = "Checker"; - private static final String TREEWALKER_MODULE = "TreeWalker"; - private static final String MODULE_NODE = "module"; - private final RuleFinder ruleFinder; - - public CheckstyleProfileImporter(RuleFinder ruleFinder) { - super(CheckstyleConstants.REPOSITORY_KEY, CheckstyleConstants.PLUGIN_NAME); - setSupportedLanguages(Java.KEY); - this.ruleFinder = ruleFinder; - } - - @Override - public RulesProfile importProfile(Reader reader, ValidationMessages messages) { - SMInputFactory inputFactory = initStax(); - RulesProfile profile = RulesProfile.create(); - try { - SMHierarchicCursor rootC = inputFactory.rootElementCursor(reader); - rootC.advance(); // - SMInputCursor rootModulesCursor = rootC.childElementCursor(MODULE_NODE); - while (rootModulesCursor.getNext() != null) { - String configKey = rootModulesCursor.getAttrValue("name"); - if (StringUtils.equals(TREEWALKER_MODULE, configKey)) { - SMInputCursor treewalkerCursor = rootModulesCursor.childElementCursor(MODULE_NODE); - while (treewalkerCursor.getNext() != null) { - processModule(profile, CHECKER_MODULE + "/" + TREEWALKER_MODULE + "/", treewalkerCursor, messages); - } - } else { - processModule(profile, CHECKER_MODULE + "/", rootModulesCursor, messages); - } - } - } catch (XMLStreamException e) { - messages.addErrorText("XML is not valid: " + e.getMessage()); - } - return profile; - } - - private SMInputFactory initStax() { - XMLInputFactory xmlFactory = XMLInputFactory.newInstance(); - xmlFactory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.TRUE); - xmlFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.FALSE); - xmlFactory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE); - xmlFactory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE); - return new SMInputFactory(xmlFactory); - } - - private void processModule(RulesProfile profile, String path, SMInputCursor moduleCursor, ValidationMessages messages) throws XMLStreamException { - String moduleName = moduleCursor.getAttrValue("name"); - if (isFilter(moduleName)) { - messages.addWarningText("Checkstyle filters are not imported: " + moduleName); - - } else if (!isIgnored(moduleName)) { - processRule(profile, path, moduleName, moduleCursor, messages); - } - } - - static boolean isIgnored(String configKey) { - return StringUtils.equals(configKey, "FileContentsHolder"); - } - - static boolean isFilter(String configKey) { - return StringUtils.equals(configKey, "SuppressionCommentFilter") || - StringUtils.equals(configKey, "SeverityMatchFilter") || - StringUtils.equals(configKey, "SuppressionFilter") || - StringUtils.equals(configKey, "SuppressWithNearbyCommentFilter"); - } - - private void processRule(RulesProfile profile, String path, String moduleName, SMInputCursor moduleCursor, ValidationMessages messages) throws XMLStreamException { - Map properties = processProps(moduleCursor); - - Rule rule; - String id = properties.get("id"); - String warning; - if (StringUtils.isNotBlank(id)) { - rule = ruleFinder.find(RuleQuery.create().withRepositoryKey(CheckstyleConstants.REPOSITORY_KEY).withKey(id)); - warning = "Checkstyle rule with key '" + id + "' not found"; - - } else { - String configKey = path + moduleName; - rule = ruleFinder.find(RuleQuery.create().withRepositoryKey(CheckstyleConstants.REPOSITORY_KEY).withConfigKey(configKey)); - warning = "Checkstyle rule with config key '" + configKey + "' not found"; - } - - if (rule == null) { - messages.addWarningText(warning); - - } else { - ActiveRule activeRule = profile.activateRule(rule, null); - activateProperties(activeRule, properties); - } - } - - private Map processProps(SMInputCursor moduleCursor) throws XMLStreamException { - Map props = Maps.newHashMap(); - SMInputCursor propertyCursor = moduleCursor.childElementCursor("property"); - while (propertyCursor.getNext() != null) { - String key = propertyCursor.getAttrValue("name"); - String value = propertyCursor.getAttrValue("value"); - props.put(key, value); - } - return props; - } - - private void activateProperties(ActiveRule activeRule, Map properties) { - for (Map.Entry property : properties.entrySet()) { - if (StringUtils.equals("severity", property.getKey())) { - activeRule.setSeverity(CheckstyleSeverityUtils.fromSeverity(property.getValue())); - - } else if (!StringUtils.equals("id", property.getKey())) { - activeRule.setParameter(property.getKey(), property.getValue()); - } - } - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleRuleRepository.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleRuleRepository.java deleted file mode 100644 index ad0ae36e89c..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleRuleRepository.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import com.google.common.collect.Lists; -import org.sonar.api.platform.ServerFileSystem; -import org.sonar.api.resources.Java; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleRepository; -import org.sonar.api.rules.XMLRuleParser; - -import java.io.File; -import java.util.List; - -public final class CheckstyleRuleRepository extends RuleRepository { - private final ServerFileSystem fileSystem; - private final XMLRuleParser xmlRuleParser; - - public CheckstyleRuleRepository(ServerFileSystem fileSystem, XMLRuleParser xmlRuleParser) { - super(CheckstyleConstants.REPOSITORY_KEY, Java.KEY); - setName(CheckstyleConstants.REPOSITORY_NAME); - this.fileSystem = fileSystem; - this.xmlRuleParser = xmlRuleParser; - } - - @Override - public List createRules() { - List rules = Lists.newArrayList(); - rules.addAll(xmlRuleParser.parse(getClass().getResourceAsStream("/org/sonar/plugins/checkstyle/rules.xml"))); - for (File userExtensionXml : fileSystem.getExtensions(CheckstyleConstants.REPOSITORY_KEY, "xml")) { - rules.addAll(xmlRuleParser.parse(userExtensionXml)); - } - return rules; - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleSensor.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleSensor.java deleted file mode 100644 index 1c0db7f6fcb..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleSensor.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.sonar.api.batch.Sensor; -import org.sonar.api.batch.SensorContext; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.resources.Java; -import org.sonar.api.resources.Project; - -public class CheckstyleSensor implements Sensor { - - private RulesProfile profile; - private CheckstyleExecutor executor; - - public CheckstyleSensor(RulesProfile profile, CheckstyleExecutor executor) { - this.profile = profile; - this.executor = executor; - } - - public boolean shouldExecuteOnProject(Project project) { - return !project.getFileSystem().mainFiles(Java.KEY).isEmpty() && - !profile.getActiveRulesByRepository(CheckstyleConstants.REPOSITORY_KEY).isEmpty(); - } - - public void analyse(Project project, SensorContext context) { - executor.execute(); - } - - @Override - public String toString() { - return getClass().getSimpleName(); - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleSeverityUtils.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleSeverityUtils.java deleted file mode 100644 index bad2f2d1a90..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleSeverityUtils.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.apache.commons.lang.StringUtils; -import org.sonar.api.rules.RulePriority; - -public final class CheckstyleSeverityUtils { - - private CheckstyleSeverityUtils() { - // only static methods - } - - public static String toSeverity(RulePriority priority) { - if (RulePriority.BLOCKER.equals(priority) || RulePriority.CRITICAL.equals(priority)) { - return "error"; - } - if (RulePriority.MAJOR.equals(priority)) { - return "warning"; - } - if (RulePriority.MINOR.equals(priority) || RulePriority.INFO.equals(priority)) { - return "info"; - } - throw new IllegalArgumentException("Priority not supported: " + priority); - } - - public static RulePriority fromSeverity(String severity) { - if (StringUtils.equals(severity, "error")) { - return RulePriority.BLOCKER; - } - if (StringUtils.equals(severity, "warning")) { - return RulePriority.MAJOR; - } - if (StringUtils.equals(severity, "info")) { - return RulePriority.INFO; - } - return null; - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleVersion.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleVersion.java deleted file mode 100644 index 115923d07cf..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleVersion.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.apache.commons.io.IOUtils; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -public enum CheckstyleVersion { - INSTANCE; - - private static final String PROPERTIES_PATH = "/org/sonar/plugins/checkstyle/checkstyle-plugin.properties"; - private String version; - - public static String getVersion() { - return INSTANCE.version; - } - - private CheckstyleVersion() { - InputStream input = getClass().getResourceAsStream(PROPERTIES_PATH); - try { - Properties properties = new Properties(); - properties.load(input); - this.version = properties.getProperty("checkstyle.version"); - - } catch (IOException e) { - LoggerFactory.getLogger(getClass()).warn("Can not load the Checkstyle version from the file " + PROPERTIES_PATH); - this.version = ""; - - } finally { - IOUtils.closeQuietly(input); - } - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayProfile.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayProfile.java deleted file mode 100644 index dc938a32322..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayProfile.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.sonar.api.profiles.ProfileDefinition; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.profiles.XMLProfileParser; -import org.sonar.api.utils.ValidationMessages; - -public final class SonarWayProfile extends ProfileDefinition { - - private XMLProfileParser xmlProfileParser; - - public SonarWayProfile(XMLProfileParser xmlProfileParser) { - this.xmlProfileParser = xmlProfileParser; - } - - @Override - public RulesProfile createProfile(ValidationMessages messages) { - return xmlProfileParser.parseResource(getClass().getClassLoader(), "org/sonar/plugins/checkstyle/profile-sonar-way.xml", messages); - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfile.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfile.java deleted file mode 100644 index 1639b6ed13e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfile.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.sonar.api.profiles.ProfileDefinition; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.utils.ValidationMessages; - -public class SonarWayWithFindbugsProfile extends ProfileDefinition { - - private SonarWayProfile sonarWay; - - public SonarWayWithFindbugsProfile(SonarWayProfile sonarWay) { - this.sonarWay = sonarWay; - } - - - @Override - public RulesProfile createProfile(ValidationMessages validationMessages) { - RulesProfile profile = sonarWay.createProfile(validationMessages); - profile.setName(RulesProfile.SONAR_WAY_FINDBUGS_NAME); - return profile; - } -} - diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SunConventionsProfile.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SunConventionsProfile.java deleted file mode 100644 index 2a926fcfe66..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SunConventionsProfile.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.sonar.api.profiles.ProfileDefinition; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.profiles.XMLProfileParser; -import org.sonar.api.utils.ValidationMessages; - -public final class SunConventionsProfile extends ProfileDefinition { - - private XMLProfileParser xmlProfileParser; - - public SunConventionsProfile(XMLProfileParser xmlProfileParser) { - this.xmlProfileParser = xmlProfileParser; - } - - - @Override - public RulesProfile createProfile(ValidationMessages messages) { - return xmlProfileParser.parseResource(getClass().getClassLoader(), "org/sonar/plugins/checkstyle/profile-sun-conventions.xml", messages); - } - -} diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/package-info.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/package-info.java deleted file mode 100644 index 23584e4a5e8..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/package-info.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ - -@ParametersAreNonnullByDefault -package org.sonar.plugins.checkstyle; - -import javax.annotation.ParametersAreNonnullByDefault; - diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties deleted file mode 100644 index 1a4c4adcd37..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties +++ /dev/null @@ -1,341 +0,0 @@ -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck.name=Missing Override -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck.param.javaFiveCompatibility=When this property is true this check will only check classes, interfaces, etc. that do not contain the extends or implements keyword or are not anonymous classes. This means it only checks methods overridden from java.lang.Object Java 5 Compatibility mode severely limits this check. It is recommended to only use it on Java 5 source. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.name=Equals Avoid Null -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.param.ignoreEqualsIgnoreCase=whether to ignore String.equalsIgnoreCase() invocations. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.name=Javadoc Package -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.param.allowLegacy=If set then allow the use of a package.html file. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck.name=Declaration Order -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck.name=Anon Inner Length -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck.param.max=maximum allowable number of lines. Default is 20. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.name=Executable Statement Count -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.param.max=the maximum threshold allowed. Default is 30. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.param.tokens=members to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.name=Whitespace After -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.name=Illegal Token Text -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.param.message=Message which is used to notify about violations; if empty then the default message is used. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.param.tokens=tokens to check. Default value is empty. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.param.format=illegal pattern -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.param.ignoreCase=Controls whether to ignore case when matching. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.ClassFanOutComplexityCheck.name=Class Fan Out Complexity -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.ClassFanOutComplexityCheck.param.max=the maximum threshold allowed. Default is 20. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck.name=Missing Deprecated -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.OuterTypeNumberCheck.name=Outer Type Number -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.OuterTypeNumberCheck.param.max=maximum allowable number of outer types. Default is 1. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck.name=Design For Extension -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.name=Illegal Throws -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.param.illegalClassNames=throw class names to reject -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.param.ignoredMethodNames=names of methods to ignore. Default is "finalize". -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.name=Avoid Star Import -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.param.excludes=packages where star imports are allowed. Note that this property is not recursive, subpackages of excluded packages are not automatically excluded. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.param.allowClassImports=whether to allow starred class imports like import java.util.*;. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.param.allowStaticMemberImports=whether to allow starred static member imports like import static org.junit.Assert.*;. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.name=Illegal Catch -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.param.illegalClassNames=exception class names to reject -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck.name=Typecast Paren Pad -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck.param.option=policy on how to pad parentheses -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck.name=Avoid Static Import -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck.param.excludes=Allows for certain classes via a star notation to be excluded such as java.lang.Math.* or specific static members to be excluded like java.lang.System.out for a variable or java.lang.Math.random for a method. If you exclude a starred import on a class this automatically excludes each member individually. For example: Excluding java.lang.Math.*. will allow the import of each static member in the Math class individually like java.lang.Math.PI. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck.name=Return Count -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck.param.format=method names to ingone -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck.param.max=maximum allowed number of return statments -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck.name=Multiple String Literals -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck.param.ignoreStringsRegexp=regexp pattern for ignored strings (with quotation marks) -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck.param.ignoreOccurrenceContext=Token type names where duplicate strings are ignored even if they don't match ignoredStringsRegexp. This allows you to exclude syntactical contexts like Annotations or static initializers from the check. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck.param.allowedDuplicates=The maximum number of occurences to allow without generating a warning. Default is 1. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck.name=Require This -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck.param.checkFields=whether we should check fields usage or not. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck.param.checkMethods=whether we should check methods usage or not. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.name=Right Curly -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.param.tokens=blocks to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.param.option=policy on placement of a right curly brace ('}') -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck.name=Unnecessary Parentheses -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck.name=Illegal Token -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck.param.tokens=tokens to check. Default value is LITERAL_SWITCH, POST_INC, POST_DEC. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck.name=Parameter Number -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck.param.tokens=declarations to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck.param.max=maximum allowable number of parameters. Default is 7. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck.name=No Whitespace Before -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck.param.allowLineBreaks=whether whitespace is allowed if the token is at a linebreak. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck.name=Missing Switch Default -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.RegexpCheck.name=Regexp -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.RegexpCheck.param.duplicateLimit=Controls whether to check for duplicates of a required pattern, any negative value means no checking for duplicates, any positive value is used as the maximum number of allowed duplicates, if the limit is exceeded errors will be logged. Default is -1. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.RegexpCheck.param.message=message which is used to notify about violations, if empty then default(hard-coded) message is used. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.RegexpCheck.param.format=pattern -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.RegexpCheck.param.ignoreComments=Controls whether to ignore matches found within comments. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.RegexpCheck.param.illegalPattern=Controls whether the pattern is required or illegal. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.RegexpCheck.param.errorLimit=Controls the maximum number of errors before the check will abort. Default is 100. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.name=Javadoc Method -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.tokens=definitions to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowMissingReturnTag=whether to ignore errors when a method returns non-void type does have a return tag in the javadoc. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowMissingThrowsTags=whether to ignore errors when a method declares that it throws exceptions but does have matching throws tags in the javadoc. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowThrowsTagsForSubclasses=whether to allow documented exceptions that are subclass of one of declared exception. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowMissingJavadoc=whether to ignore errors when a method javadoc is missed. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowMissingParamTags=whether to ignore errors when a method has parameters but does not have matching param tags in the javadoc. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.scope=visibility scope where Javadoc comments are checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowMissingPropertyJavadoc=Whether to allow missing Javadoc on accessor methods for properties (setters and getters). The setter and getter methods must match exactly the structures below. public void setNumber(final int number) { mNumber = number; } public int getNumber() { return mNumber; } public boolean isSomething() { return false; } . Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.excludeScope=visibility scope where Javadoc comments are not checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.allowUndeclaredRTE=whether to allow documented exceptions that are not declared if they are a subclass of java.lang.RuntimeException. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.param.suppressLoadErrors=When set to false all problems with loading classes would be reported as violations. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.name=Regexp Singleline Java -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.param.ignoreCase=Controls whether to ignore case when searching. Default value is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.param.ignoreComments=Controls whether to ignore text in comments when searching. Default value is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.param.maximum=The maximum number of matches required in each file. Default value is 0. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.param.format=illegal pattern. Default value is ^$ (empty). -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.param.minimum=The minimum number of matches required in each file. Default value is 0. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.param.message=message which is used to notify about violations, if empty then default(hard-coded) message is used. Default value is "" (empty). -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentCheck.name=Parameter Assignment -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck.name=Javadoc Variable -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck.param.excludeScope=visibility scope where Javadoc comments are not checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck.param.scope=visibility scope where Javadoc comments are checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck.name=Illegal Instantiation -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck.param.classes=classes that should not be instantiated -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck.name=Method Length -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck.param.countEmpty=whether to count empty lines and single line comments of the form //. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck.param.max=maximum allowable number of lines. Default is 150. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck.param.tokens=blocks to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck.name=Hide Utility Class Constructor -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVariableCheck.name=Modified Control Variable -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.name=Magic Number -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.param.ignoreNumbers=non-magic numbers. Default is -1,0,1,2. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.param.ignoreHashCodeMethod=ignore magic numbers in hashCode methods. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.param.ignoreAnnotation=ignore magic numbers in annotation declarations. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.name=Header -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.param.header=the required header specified inline. Individual header lines must be separated by the string "\n" (even on platforms with a different line separator) -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.param.ignoreLines=comma-separated list of line numbers to ignore -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck.name=Avoid Inline Conditionals -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck.name=Nested Try Depth -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck.param.max=allowed nesting depth. Default is 1. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.name=Trailing Comment -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.param.legalComment=pattern for text of trailing comment which is allowed. (this patter will not be applied to multiline comments and text of comment will be trimmed before matching) -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.param.format=pattern for string allowed before comment. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck.name=Parameter Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck.name=Redundant Modifier -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck.name=Empty For Initializer Pad -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck.param.option=policy on how to pad an empty for iterator -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.name=Javadoc Style -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.param.checkHtml=Whether to check for incomplete html tags. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.param.excludeScope=visibility scope where Javadoc comments are not checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.param.scope=visibility scope where Javadoc comments are checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.param.checkEmptyJavadoc=Whether to check if the Javadoc is missing a describing text. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.param.tokens=definitions to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.param.checkFirstSentence=Whether to check the first sentence for proper end of sentence. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.name=Line Length -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.param.ignorePattern=pattern for lines to ignore -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.param.tabWidth=number of expanded spaces for a tab character. Default is 8. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.param.max=maximum allowable line length. Default is 80. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.name=Regexp Multiline -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.param.minimum=The minimum number of matches required in each file. Default value is 0. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.param.message=message which is used to notify about violations, if empty then default(hard-coded) message is used. Default value is "" (empty). -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.param.ignoreCase=Controls whether to ignore case when searching. Default value is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.param.format=illegal pattern. Default value is ^$ (empty). -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.param.maximum=The maximum number of matches required in each file. Default value is 0. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.name=File Tab Character -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.param.eachLine=whether to report on each line containing a tab, or just the first instance. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck.name=Unused Imports -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck.param.processJavadoc=whether to process Javadoc. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck.name=Simplify Boolean Expression -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.name=Uncommented Main -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.param.excludedClasses=pattern for qualified names of classes which are allowed to have a main method. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck.name=Local Variable Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck.param.tokens=Controls whether the check applies to variable declarations or catch clause parameters -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck.name=Interface Is Type -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck.param.allowMarkerInterfaces=Controls whether marker interfaces like Serializable are allowed. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck.name=NPath Complexity -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck.param.max=the maximum threshold allowed. Default is 200. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck.name=Simplify Boolean Return -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck.name=Cyclomatic Complexity -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck.param.max=the maximum threshold allowed. Default is 10. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck.name=Annotation Use Style -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck.param.closingParens=Defines the policy for ending parenthesis. Default is never. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck.param.elementStyle=Defines the annotation element styles. Default value is compact_no_array. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck.param.trailingArrayComma=Defines the policy for trailing comma in arrays. Default is never. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck.name=Paren Pad -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck.param.option=policy on how to pad parentheses -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck.name=Method Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck.param.allowClassName=Controls whether to allow a method name to have the same name as the residing class name. This is not to be confused with a constructor. An easy mistake is to place a return type on a constructor declaration which turns it into a method. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck.name=Modifier Order -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck.name=Explicit Initialization -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck.name=Static Variable Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck.param.applyToProtected=Controls whether to apply the check to protected member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck.param.applyToPrivate=Controls whether to apply the check to private member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck.param.applyToPackage=Controls whether to apply the check to package-private member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck.param.applyToPublic=Controls whether to apply the check to public member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck.name=Empty Statement -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.name=Illegal Type -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.param.ignoredMethodNames=methods that should not be checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.param.illegalClassNames=classes that should not be used as types in variable declarations, return values or parameters. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.param.legalAbstractClassNames=abstract classes that may be used as types. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.param.format=pattern for illegal class name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.name=Method Param Pad -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.param.option=policy on how to pad method parameter. Default is nospace. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.param.allowLineBreaks=whether a line break between the identifier and left parenthesis is allowed. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.name=Javadoc Type -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.param.excludeScope=visibility scope where Javadoc comments are not checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.param.authorFormat=pattern for @author tag -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.param.tokens=definitions to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.param.scope=visibility scope where Javadoc comments are checked -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.param.allowMissingParamTags=whether to ignore errors when a class has type parameters but does not have matching param tags in the javadoc. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.param.allowUnknownTags=whether to ignore errors when a Javadoc tag is not recognised. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.param.versionFormat=pattern for @version tag -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck.name=Final Parameters -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck.param.tokens=blocks to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.name=Empty For Iterator Pad -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.param.option=policy on how to pad an empty for iterator -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck.name=Illegal Import -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck.param.illegalPkgs=packages to reject -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck.name=Comment pattern matcher -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck.param.format=Regular expression pattern to check. Default is TODO: -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck.name=Multiple Variable Declarations -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.name=Write Tag -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.param.tagSeverity=Severity level when tag is found and printed. Default is info. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.param.tagFormat=Format of tag -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.param.tag=Name of tag -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.name=Operator Wrap -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.param.option=policy on how to wrap lines. 'nl' : the operator must be on a new line, 'eol' : the operator must be at the end of the line. Default is 'nl'. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.name=Regexp Header -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.param.header=The required header specified inline. Individual header lines must be separated by the string "\n" (even on platforms with a different line separator), and regular expressions must not span multiple lines. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.param.multiLines=Line numbers to repeat (zero or more times) -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck.name=Default Comes Last -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck.name=No Whitespace After -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck.param.allowLineBreaks=whether whitespace is allowed if the token is at a linebreak. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.ThrowsCountCheck.name=Throws Count -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.ThrowsCountCheck.param.max=maximum allowed number of throws statments -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck.name=Mutable Exception -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck.param.format=pattern for name of exception class. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.name=Equals Hash Code -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.SuperFinalizeCheck.name=Super Finalize -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck.name=Final Local Variable -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck.name=Suppress Warnings -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck.param.format=The warnings property is a regex pattern. Any warning being suppressed matching this pattern will be flagged. Default is ^$|^\s+$ -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck.param.tokens=Tokens to check : CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF ENUM_CONSTANT_DEF, PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, CTOR_DEF. Default value is LASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF, ENUM_CONSTANT_DEF, PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF, CTOR_DEF. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck.name=Covariant Equals -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck.name=Empty Block -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck.param.tokens=blocks to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck.param.option=policy on block contents -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck.name=Boolean Expression Complexity -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck.param.tokens=tokens to check. Default is LAND,BAND,LOR,BOR,BXOR. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck.param.max=the maximum allowed number of boolean operations in one expression. Default is 3. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck.name=Redundant import -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck.name=Package Annotation -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck.name=Array Type Style -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck.param.javaStyle=Controls whether to enforce Java style (true) or C style (false). Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.name=Indentation -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.param.tabWidth=number of expanded spaces for a tab character -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.param.caseIndent=how much to indent a case label -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.param.braceAdjustment=how far brace should be indented when on next line -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.param.basicOffset=how many spaces to use for new indentation level -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck.name=Final Class -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck.name=Avoid Nested Blocks -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck.param.allowInSwitchCase=Allow nested blocks in case statements. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.name=Need Braces -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.param.tokens=blocks to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.name=Abstract Class Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.param.ignoreModifier=Controls whether to ignore checking for the abstract modifier on classes that match the name. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.param.ignoreName=Controls whether to ignore checking the name. Realistically only useful if using the check to identify that match name and do not have the abstract modifier name. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck.name=Missing Constructor -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck.name=Package Declaration -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck.param.ignoreDirectoryName=whether to ignore checking that the package declaration matches the source directory name. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.name=JavaNCSS -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.param.classMaximum=the maximum allowed number of non commenting lines in a class. Default is 1500. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.param.methodMaximum=the maximum allowed number of non commenting lines in a method. Default is 50. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.param.fileMaximum=the maximum allowed number of non commenting lines in a file including all top level and nested classes. Default is 2000. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.name=Hidden Field -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.param.ignoreSetter=Controls whether to ignore the parameter of a property setter method, where the property setter method for field 'xyz' has name 'setXyz', one parameter named 'xyz', and return type void. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.param.ignoreConstructorParameter=Controls whether to ignore constructor parameters. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.param.ignoreAbstractMethods=Controls whether to ignore parameters of abstract methods. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.param.ignoreFormat=pattern for names to ignore -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.name=Regexp Singleline -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.param.format=illegal pattern. Default value is ^$ (empty). -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.param.ignoreCase=Controls whether to ignore case when searching. Default value is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.param.message=message which is used to notify about violations, if empty then default(hard-coded) message is used. Default value is "" (empty). -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.param.maximum=The maximum number of matches required in each file. Default value is 0. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.param.minimum=The minimum number of matches required in each file. Default value is 0. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck.name=File Length -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck.param.max=maximum allowable number of lines. Default is 2000. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.name=Newline At End Of File -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.param.fileExtensions=file type extension of the files to check. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.param.lineSeparator=type of line separator. One of 'system' (system default), 'crlf' (Windows-style), 'cr' (Mac-style) and 'lf' (Unix-style). -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck.name=Visibility Modifier -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck.param.protectedAllowed=whether protected members are allowed. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck.param.publicMemberPattern=pattern for public members that should be ignored. Default is ^serialVersionUID$. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck.param.packageAllowed=whether package visible members are allowed. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck.name=String Literal Equality -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.ClassDataAbstractionCouplingCheck.name=Class Data Abstraction Coupling -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.metrics.ClassDataAbstractionCouplingCheck.param.max=the maximum threshold allowed. Default is 7. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck.name=Fall Through -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck.param.checkLastCaseGroup=Whether we need to check last case group or not. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck.param.reliefPattern=Regulare expression to match the relief comment that supresses the warning about a fall through. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck.name=Inner Assignment -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck.param.tokens=assignments to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.duplicates.StrictDuplicateCodeCheck.name=Strict Duplicate Code -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.duplicates.StrictDuplicateCodeCheck.param.charset=name of the file charset -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.duplicates.StrictDuplicateCodeCheck.param.min=how many lines must be equal to be considered a duplicate. Default is 12. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.name=Import Order -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.separated=whether imports groups should be separated by, at least, one blank line. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.caseSensitive=whether string comparision should be case sensitive or not. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.groups=list of imports groups (every group identified either by a common prefix string, or by a regular expression enclosed in forward slashes (e.g. /regexp/) -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.option=policy on the relative order between regular imports and static imports. Values are top, above, inflow, under, bottom. See examples: http://checkstyle.sourceforge.net/property_types.html#importOrder -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.param.ordered=whether imports within group should be sorted. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.name=Whitespace Around -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.param.tokens=tokens to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.param.allowEmptyConstructors=allow empty constructor bodies. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.param.allowEmptyMethods=allow empty method bodies. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck.name=No Finalizer -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.name=Upper Ell -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck.name=Nested If Depth -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck.param.max=allowed nesting depth. Default is 1. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck.name=Package name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.name=Type Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.param.tokens=Control whether the check applies to classes or interfaces -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.param.applyToPackage=Controls whether to apply the check to package-private member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.param.applyToProtected=Controls whether to apply the check to protected member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.param.applyToPublic=Controls whether to apply the check to public member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.param.applyToPrivate=Controls whether to apply the check to private member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.name=Constant Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.param.applyToProtected=Controls whether to apply the check to protected member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.param.applyToPackage=Controls whether to apply the check to package-private member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.param.applyToPublic=Controls whether to apply the check to public member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.param.applyToPrivate=Controls whether to apply the check to private member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.SuperCloneCheck.name=Super Clone -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.name=Left Curly -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.param.maxLineLength=maximum number of characters in a line. Default is 80. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.param.tokens=blocks to check -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.param.option=policy on placement of a left curly brace ('{'). eol : the brace must always be on the end of the line, nl : he brace must always be on a new line, nlow : ff the brace will fit on the first line of the statement, taking into account maximum line length, then apply eol rule. Otherwise apply the nl rule. nlow is a mnemonic for 'new line on wrap'. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck.name=Local Final Variable Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.name=Member name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.param.applyToPackage=Controls whether to apply the check to package-private member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.param.applyToPublic=Controls whether to apply the check to public member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.param.applyToPrivate=Controls whether to apply the check to private member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.param.applyToProtected=Controls whether to apply the check to protected member -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.name=Redundant Throws -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.param.allowSubclasses=whether subclass of another declared exception is allowed in throws clause. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.param.allowUnchecked=whether unchecked exceptions in throws are allowed or not. Default is false. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.param.suppressLoadErrors=When set to false all problems with loading classes would be reported as violations. Default is true. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCheck.name=Array Trailing Comma -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.name=Generic Whitespace -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck.name=No Clone -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.name=Inner Type Last -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.name=Outer Type Filename -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.name=Nested For Depth -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.param.max=allowed nesting depth. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.name=Method Count -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxTotal=maximum allowable number of methods at all scope levels. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxPrivate=maximum allowable number of private methods. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxPackage=maximum allowable number of package methods. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxProtected=maximum allowable number of protected methods. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.param.maxPublic=maximum allowable number of public methods. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.name=One Statement Per Line -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck.name=Class Type(Generic) Parameter Name -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck.name=Method Type(Generic) Parameter Name diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck.html deleted file mode 100644 index c05741bc600..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the style of array type definitions. Some like Java-style: public static void main(String[] args) and some like C-style: public static void main(String args[]) \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck.html deleted file mode 100644 index daf1cb0ddb9..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck.html +++ /dev/null @@ -1 +0,0 @@ -Check that method/constructor/catch/foreach parameters are final. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.html deleted file mode 100644 index 33478373ab0..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that there is a newline at the end of each file. Any source files and text files in general should end with a newline character, especially when using SCM systems such as CVS. CVS will even print a warning when it encounters a file that doesn't end with a newline. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.html deleted file mode 100644 index fb9b208d998..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that the outer type name and the file name match. For example, the class Foo must be in a file named Foo.java. diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.RegexpCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.RegexpCheck.html deleted file mode 100644 index 331c5e81251..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.RegexpCheck.html +++ /dev/null @@ -1 +0,0 @@ -A check that makes sure that a specified pattern exists (or not) in the file. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck.html deleted file mode 100644 index 3ccbbb0d3a3..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck.html +++ /dev/null @@ -1 +0,0 @@ -This rule allows to find any kind of pattern inside comments like TODO, NOPMD, ..., except NOSONAR \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.html deleted file mode 100644 index 1a58f64f62d..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.html +++ /dev/null @@ -1,41 +0,0 @@ -

- The check to ensure that requires that comments be the only thing on a line. For the case of // comments that means that the only thing that should precede it is whitespace. It - doesn't check comments if they do not end line, i.e. it accept the following: Thread.sleep( 10 <some comment here> ); Format property is intended to deal with the "} // - while" example. -

-

- Rationale: Steve McConnel in "Code Complete" suggests that endline comments are a bad practice. An end line comment would be one that is on the same line as actual code. For - example: -

-
-  
-    a = b + c; // Some insightful comment
-    d = e / f; // Another comment for this line
-  
-
- -

- Quoting "Code Complete" for the justfication: -

-
    -
  • "The comments have to be aligned so that they do not interfere with the visual structure of the code. If you don't align them neatly, they'll make your listing look like it's - been through a washing machine." -
  • -
  • "Endline comments tend to be hard to format...It takes time to align them. Such time is not spent learning more about the code; it's dedicated solely to the tedious task of - pressing the spacebar or tab key." -
  • -
  • "Endline comments are also hard to maintain. If the code on any line containing an endline comment grows, it bumps the comment farther out, and all the other endline comments - will have to bumped out to match. Styles that are hard to maintain aren't maintained...." -
  • -
  • "Endline comments also tend to be cryptic. The right side of the line doesn't offer much room and the desire to keep the comment on one line means the comment must be short. - Work - then goes into making the line as short as possible instead of as clear as possible. The comment usually ends up as cryptic as possible...." -
  • -
  • "A systemic problem with endline comments is that it's hard to write a meaningful comment for one line of code. Most endline comments just repeat the line of code, which - hurts - more than it helps." -
  • -
-

- His comments on being hard to maintain when the size of the line changes are even more important in the age of automated refactorings. -

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.html deleted file mode 100644 index cbbe20a1465..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.html +++ /dev/null @@ -1 +0,0 @@ -Detects uncommented main methods. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.html deleted file mode 100644 index fc5012104b8..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.html +++ /dev/null @@ -1,2 +0,0 @@ -Checks that long constants are defined with an upper ell. That is ' L' and not 'l'. - This is in accordance to the Java Language Specification, Section 3.10.1. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck.html deleted file mode 100644 index e5dd5a79881..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck.html +++ /dev/null @@ -1 +0,0 @@ -Controls the style with the usage of annotations. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck.html deleted file mode 100644 index 4ea00907b96..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck.html +++ /dev/null @@ -1 +0,0 @@ -Verifies that both the java.lang.Deprecated annotation is present and the @deprecated Javadoc tag is present when either is present. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck.html deleted file mode 100644 index bf6416b703d..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideCheck.html +++ /dev/null @@ -1 +0,0 @@ -Verifies that the java.lang.Override annotation is present when the {@inheritDoc} javadoc tag is present. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck.html deleted file mode 100644 index 603bee97cfc..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck.html +++ /dev/null @@ -1,3 +0,0 @@ -

This check makes sure that all package annotations are in the package-info.java file.

-

According to the Java JLS 3rd ed.

-

The JLS does not enforce the placement of package annotations. This placement may vary based on implementation. The JLS does highly recommend that all package annotations are placed in the package-info.java file. See Java Language specification, sections 7.4.1.1.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck.html deleted file mode 100644 index e14901c2c19..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck.html +++ /dev/null @@ -1,3 +0,0 @@ -

This check allows you to specify what warnings that SuppressWarnings is not allowed to suppress. You can also specify a list of TokenTypes that the configured warning(s) cannot be suppressed on.

-

Limitations: This check does not consider conditionals inside the SuppressWarnings annotation. -For example: @SupressWarnings((false) ? (true) ? "unchecked" : "foo" : "unused") According to the above example, the "unused" warning is being suppressed not the "unchecked" or "foo" warnings. All of these warnings will be considered and matched against regardless of what the conditional evaluates to.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck.html deleted file mode 100644 index 11dbe18d852..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck.html +++ /dev/null @@ -1 +0,0 @@ -Finds nested blocks. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck.html deleted file mode 100644 index c12f680d332..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for empty blocks. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.html deleted file mode 100644 index 7b02cf8dd89..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for the placement of left curly braces for code blocks. The policy to verify is specified using property option. Policies eol and nlow take into account property maxLineLength. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.html deleted file mode 100644 index 13d343aec46..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for braces around code blocks. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.html deleted file mode 100644 index 6343865a222..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the placement of right curly braces. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCheck.html deleted file mode 100644 index f459d608463..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks if array initialization contains optional trailing comma. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck.html deleted file mode 100644 index 8ca3853d20f..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck.html +++ /dev/null @@ -1 +0,0 @@ -Detects inline conditionals. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck.html deleted file mode 100644 index bb2540cbe32..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that if a class defines a covariant method equals, then it defines method equals(java.lang.Object). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck.html deleted file mode 100644 index 85cd2567970..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that the parts of a class or interface declaration appear in the order suggested by the Code Convention for the Java Programming Language :
  • Class (static) variables. First the public class variables, then the protected, then package level (no access modifier), and then the private.
  • Instance variables. First the public class variables, then the protected, then package level (no access modifier), and then the private.
  • Constructors
  • Methods
\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck.html deleted file mode 100644 index fc80c045f81..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck.html +++ /dev/null @@ -1 +0,0 @@ -Check that the default is after all the cases in a switch statement. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck.html deleted file mode 100644 index c30d4a1d95b..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck.html +++ /dev/null @@ -1 +0,0 @@ -Detects empty statements (standalone ';'). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.html deleted file mode 100644 index 924022b997c..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck.html +++ /dev/null @@ -1,25 +0,0 @@ -

Checks that any combination of String literals with optional assignment is on the left side of an equals() comparison.

-

Rationale: Calling the equals() method on String literals will avoid a potential NullPointerException. Also, it is pretty common to see null check right before equals comparisons which is not necessary in the below example.

-

For example: -

-  String nullString = null;
-  nullString.equals("My_Sweet_String");
-
-

- -

-should be refactored to: -

-  String nullString = null;
-  "My_Sweet_String".equals(nullString);
-
-

-

Limitations: If the equals method is overridden or a covariant equals method is defined and the implementation is incorrect (where s.equals(t) does not return the same result as t.equals(s)) then rearranging the called on object and parameter may have unexpected results.

-

Java's Autoboxing feature has an affect on how this check is implemented. Pre Java 5 all IDENT + IDENT object concatenations would not cause a NullPointerException even if null. Those situations could have been included in this check. They would simply act as if they surrounded by String.valueof() which would concatenate the String null.

-

The following example will cause a NullPointerException as a result of what autoboxing does.

-
-  Integer i = null, j = null;
-  String number = "5"
-  number.equals(i + j);
-
-

Since, it is difficult to determine what kind of Object is being concatenated all ident concatenation is considered unsafe.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.html deleted file mode 100644 index e434ba12184..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that classes that override equals() also override hashCode(). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck.html deleted file mode 100644 index ac96994257d..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks if any class or object member explicitly initialized to default for its type value (null for object references, zero for numeric types and char and false for boolean. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck.html deleted file mode 100644 index 4e754430335..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for fall through in switch statements Finds locations where a case contains Java code - but lacks a break, return, throw or continue statement. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck.html deleted file mode 100644 index 3b92f762472..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck.html +++ /dev/null @@ -1 +0,0 @@ -Ensures that local variables that never get their values changed, must be declared final. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.html deleted file mode 100644 index 9d2ee01d250..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that a local variable or a parameter does not shadow a field that is defined in the same class. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.html deleted file mode 100644 index 8200f9cb4e6..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.html +++ /dev/null @@ -1 +0,0 @@ -Catching java.lang.Exception, java.lang.Error or java.lang.RuntimeException is almost never acceptable. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck.html deleted file mode 100644 index c4ba6c5309e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for illegal instantiations where a factory method is preferred. Depending on the project, for some classes it might be preferable to create instances through factory methods rather than calling the constructor. A simple example is the java.lang.Boolean class. In order to save memory and CPU cycles, it is preferable to use the predefined constants TRUE and FALSE. Constructor invocations should be replaced by calls to Boolean.valueOf(). Some extremely performance sensitive projects may require the use of factory methods for other classes as well, to enforce the usage of number caches or object pools. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.html deleted file mode 100644 index 5f45e6ccb05..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.html +++ /dev/null @@ -1 +0,0 @@ -Throwing java.lang.Error or java.lang.RuntimeException is almost never acceptable. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck.html deleted file mode 100644 index c91cfa2b1a0..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for illegal tokens. Certain language features often lead to hard to maintain code or are non-obvious to novice developers. Other features may be discouraged in certain frameworks, such as not having native methods in EJB components. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.html deleted file mode 100644 index 481552a2241..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for illegal token text. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.html deleted file mode 100644 index 82dec7327a8..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that particular class are never used as types in variable declarations, return values or parameters. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck.html deleted file mode 100644 index a3aa05d304e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for assignments in subexpressions, such as in String s = Integer.toString(i = 2);. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.html deleted file mode 100644 index 74d330890bb..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for magic numbers. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck.html deleted file mode 100644 index b1931bb998d..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that classes (except abstract one) define a constructor and don't rely on the default one. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck.html deleted file mode 100644 index b4dcae8f785..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that switch statement has default clause. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVariableCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVariableCheck.html deleted file mode 100644 index f30b9e028d9..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVariableCheck.html +++ /dev/null @@ -1 +0,0 @@ -Check for ensuring that for loop control variables are not modified inside the for block. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck.html deleted file mode 100644 index 8a989b7b08a..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it can be better to replace the multiple occurrences with a constant. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck.html deleted file mode 100644 index 6db93240fe8..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that each variable declaration is in its own statement and on its own line. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.html deleted file mode 100644 index 7abe9d48343..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck.html +++ /dev/null @@ -1 +0,0 @@ -Restricts nested for blocks to a specified depth. diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck.html deleted file mode 100644 index 47a0f39c6bf..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck.html +++ /dev/null @@ -1 +0,0 @@ -Restricts nested if-else blocks to a specified depth (default = 1). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck.html deleted file mode 100644 index 33b65efc5c0..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck.html +++ /dev/null @@ -1 +0,0 @@ -Restricts nested try-catch-finally blocks to a specified depth (default = 1). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck.html deleted file mode 100644 index 906be8cf339..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck.html +++ /dev/null @@ -1,39 +0,0 @@ -

Checks that the clone method is not overridden from the Object class.

- -

Rationale: The clone method relies on strange/hard to follow rules that do not work it all situations. Consequently, it is difficult to override correctly. Below are some of the rules/reasons why the clone method should be avoided. -

    -
  • Classes supporting the clone method should implement the Cloneable interface but the Cloneable interface does not include the clone method. As a result, it doesn't enforce the method override.
  • -
  • The Cloneable interface forces the Object's clone method to work correctly. Without implementing it, the Object's clone method will throw a CloneNotSupportedException.
  • -
  • Non-final classes must return the object returned from a call to super.clone().
  • -
  • Final classes can use a constructor to create a clone which is different from non-final classes.
  • -
  • If a super class implements the clone method incorrectly all subclasses calling super.clone() are doomed to failure.
  • -
  • If a class has references to mutable objects then those object references must be replaced with copies in the clone method after calling super.clone().
  • -
  • The clone method does not work correctly with final mutable object references because final references cannot be reassigned.
  • -
  • If a super class overrides the clone method then all subclasses must provide a correct clone implementation.
  • -

-

Two alternatives to the clone method, in some cases, is a copy constructor or a static factory method to return copies of an object. Both of these approaches are simpler and do not conflict with final fields. The do not force the calling client to handle a CloneNotSuportException. They also are typed therefore no casting is necessary. Finally, they are more flexible since they can take interface types rather than concrete classes.

- -

Sometimes a copy constructor or static factory is not an acceptable alternative to the clone method. The example below highlights the limitation of a copy constructor (or static factory). Assume Square is a subclass for Shape.

-

-

-  Shape s1 = new Square();
-  System.out.println(s1 instanceof Square); //true
-

-

...assume at this point the code knows nothing of s1 being a Square that's the beauty of polymorphism but the code wants to copy the Square which is declared as a Shape, its super type...

-

-

-  Shape s2 = new Shape(s1); //using the copy constructor
-  System.out.println(s2 instanceof Square); //false
-

- -

The working solution (without knowing about all subclasses and doing many casts) is to do the following (assuming correct clone implementation).
-

-  Shape s2 = s1.clone();
-  System.out.println(s2 instanceof Square); //true
-

- -

Just keep in mind if this type of polymorphic cloning is required then a properly implemented clone method may be the best choice.

- -

Much of this information was taken from Effective Java: Programming Language Guide First Edition by Joshua Bloch pages 45-52. Give Bloch credit for writing an excellent book.

- -

This check is almost exactly the same as the "No Finalizer Check".

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck.html deleted file mode 100644 index c3546d251f6..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck.html +++ /dev/null @@ -1 +0,0 @@ -

Verifies there are no finalize() methods defined in a class.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.html deleted file mode 100644 index 765dbe7815e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks there is only one statement per line. The following line will be flagged as an error: x = 1; y = 2; // Two statments on a single line. diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck.html deleted file mode 100644 index 7d5ec6bc976..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck.html +++ /dev/null @@ -1 +0,0 @@ -Ensures there is a package declaration. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentCheck.html deleted file mode 100644 index 9b5ca5e322d..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentCheck.html +++ /dev/null @@ -1 +0,0 @@ -Disallow assignment of parameters. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.html deleted file mode 100644 index dffae7f6ec7..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for redundant exceptions declared in throws clause such as duplicates, unchecked exceptions or subclasses of another declared exception. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck.html deleted file mode 100644 index 0ffa3b68a33..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that code doesn't rely on the this default. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck.html deleted file mode 100644 index 0dc78d7268b..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck.html +++ /dev/null @@ -1 +0,0 @@ -Restricts return statements to a specified count (default = 2). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck.html deleted file mode 100644 index d1fd1d6d2ab..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for overly complicated boolean expressions. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck.html deleted file mode 100644 index 5df60a4bf6e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for overly complicated boolean return statements. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck.html deleted file mode 100644 index 38e85b0e697..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that string literals are not used with == or !=. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SuperCloneCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SuperCloneCheck.html deleted file mode 100644 index bc86592e449..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SuperCloneCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that an overriding clone() method invokes super.clone(). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SuperFinalizeCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SuperFinalizeCheck.html deleted file mode 100644 index f3fd14f1e13..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.SuperFinalizeCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that an overriding finalize() method invokes super.finalize(). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck.html deleted file mode 100644 index d1f4257c982..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks if unnecessary parentheses are used in a statement or expression. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck.html deleted file mode 100644 index 901bb722e9f..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that classes are designed for inheritance. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck.html deleted file mode 100644 index 1df1c9d4778..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that class which has only private constructors is declared as final. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck.html deleted file mode 100644 index c1b26fa9981..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck.html +++ /dev/null @@ -1 +0,0 @@ -Make sure that utility classes (classes that contain only static methods) do not have a public constructor. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.html deleted file mode 100644 index 4fb3a32525d..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.html +++ /dev/null @@ -1 +0,0 @@ -Check nested (internal) classes/interfaces are declared at the bottom of the class after all method and field declarations. diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck.html deleted file mode 100644 index 5bd9cd7f494..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck.html +++ /dev/null @@ -1 +0,0 @@ -Implements Bloch, Effective Java, Item 17 - Use Interfaces only to define types. According to Bloch, an interface should describe a type. It is therefore inappropriate to define an interface that does not contain any methods but only constants. The Standard class javax.swing.SwingConstants is an example of a class that would be flagged by this check. The check can be configured to also disallow marker interfaces like java.io.Serializable, that do not contain methods or constants at all. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck.html deleted file mode 100644 index 8d885693d80..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck.html +++ /dev/null @@ -1 +0,0 @@ -Ensures that exceptions (defined as any class name conforming to some regular expression) are immutable. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.ThrowsCountCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.ThrowsCountCheck.html deleted file mode 100644 index c331f4db273..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.ThrowsCountCheck.html +++ /dev/null @@ -1 +0,0 @@ -Restricts throws statements to a specified count (default = 1). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck.html deleted file mode 100644 index 38f2c4f7d46..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks visibility of class members. Only static final members may be public; other class members must be private unless property protectedAllowed or packageAllowed is set. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.duplicates.StrictDuplicateCodeCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.duplicates.StrictDuplicateCodeCheck.html deleted file mode 100644 index a80f3f8f3c1..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.duplicates.StrictDuplicateCodeCheck.html +++ /dev/null @@ -1 +0,0 @@ -Performs a line-by-line comparison of all code lines and reports duplicate code if a sequence of lines differs only in indentation. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.html deleted file mode 100644 index f2dc2f11811..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck.html +++ /dev/null @@ -1,10 +0,0 @@ -

Checks that a source file begins with a specified header. Property headerFile specifies a file that contains the required header. Alternatively, the header specification can be set directly in the header property without the need for an external file.

-

Property ignoreLines specifies the line numbers to ignore when matching lines in a header file. This property is very useful for supporting headers that contain copyright dates. For example, consider the following header:

-
-	line 1: ////////////////////////////////////////////////////////////////////
-	line 2: // checkstyle:
-	line 3: // Checks Java source code for adherence to a set of rules.
-	line 4: // Copyright (C) 2002  Oliver Burn
-	line 5: ////////////////////////////////////////////////////////////////////
-
-

Since the year information will change over time, you can tell Checkstyle to ignore line 4 by setting property ignoreLines to 4.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.html deleted file mode 100644 index 99ccee2a631..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.html +++ /dev/null @@ -1,30 +0,0 @@ -

Checks the header of a source file against a header that contains a regular expression for each line of the source header.

-

Rationale: In some projects checking against a fixed header is not sufficient, e.g. the header might require a copyright line where the year information is not static. For example, consider the following header:

-
-	line  1: ^/{71}$
-	line  2: ^// checkstyle:$
-	line  3: ^// Checks Java source code for adherence to a set of rules\.$
-	line  4: ^// Copyright \(C\) \d\d\d\d  Oliver Burn$
-	line  5: ^// Last modification by \$Author.*\$$
-	line  6: ^/{71}$
-	line  7:
-	line  8: ^package
-	line  9:
-	line 10: ^import
-	line 11:
-	line 12: ^/\*\*
-	line 13: ^ \*([^/]|$)
-	line 14: ^ \*/
-
-

Lines 1 and 6 demonstrate a more compact notation for 71 '/' characters. Line 4 enforces that the copyright notice includes a four digit year. Line 5 is an example how to enforce revision control keywords in a file header. Lines 12-14 is a template for javadoc (line 13 is so complicated to remove conflict with and of javadoc comment).

-

Different programming languages have different comment syntax rules, but all of them start a comment with a non-word character. Hence you can often use the non-word character class to abstract away the concrete comment syntax and allow checking the header for different languages with a single header definition. For example, consider the following header specification (note that this is not the full Apache license header):

-
-	line 1: ^#!
-	line 2: ^<\?xml.*>$
-	line 3: ^\W*$
-	line 4: ^\W*Copyright 2006 The Apache Software Foundation or its licensors, as applicable\.$
-	line 5: ^\W*Licensed under the Apache License, Version 2\.0 \(the "License"\);$
-	line 6: ^\W*$
-
-

Lines 1 and 2 leave room for technical header lines, e.g. the "#!/bin/sh" line in Unix shell scripts, or the xml file header of XML files. Set the multiline property to "1, 2" so these lines can be ignored for file types where they do no apply. Lines 3 through 6 define the actual header content. Note how lines 2, 4 and 5 use escapes for characters that have special regexp semantics.

-

Note: ignoreLines property has been removed from this check to simplify it. To make some line optional use "^.*$" regexp for this line.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.html deleted file mode 100644 index 3e919826f47..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck.html +++ /dev/null @@ -1 +0,0 @@ -Check that finds import statements that use the * notation. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck.html deleted file mode 100644 index a37654bc7e4..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck.html +++ /dev/null @@ -1 +0,0 @@ -

Checks that there are no static import statements. Rationale: Importing static members can lead to naming conflicts between class' members. It may lead to poor code readability since it may no longer be clear what class a member resides in (without looking at the import statement).

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck.html deleted file mode 100644 index aa693d3a0dd..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for imports from a set of illegal packages, like sun.* \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.html deleted file mode 100644 index e1e0105b451..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck.html +++ /dev/null @@ -1,7 +0,0 @@ -Checks the ordering/grouping of imports. Features are:
    -
  • groups imports: ensures that groups of imports come in a specific order (e.g., java. comes first, javax. comes second, then everything else)
  • -
  • adds a separation between groups : ensures that a blank line sit between each group
  • -
  • sorts imports inside each group: ensures that imports within each group are in lexicographic order
  • -
  • sorts according to case: ensures that the comparison between imports is case sensitive
  • -
  • groups static imports: ensures the relative order between regular imports and static imports
  • -
\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck.html deleted file mode 100644 index 9ddf8a459ad..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck.html +++ /dev/null @@ -1,5 +0,0 @@ -Checks for redundant import statements. An import statement is considered redundant if: -
    -
  • It is a duplicate of another import. This is, when a class is imported more than once.
  • -
  • The class imported is from the java.lang package, e.g. importing java.lang.String.
  • -
  • The class imported is from the same package.
\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck.html deleted file mode 100644 index 3e568a92459..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for unused import statements. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.html deleted file mode 100644 index 7d0479f8109..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks correct indentation of Java Code. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.html deleted file mode 100644 index 7961ff29fbb..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.html +++ /dev/null @@ -1,15 +0,0 @@ -Checks the Javadoc of a method or constructor. By default, does not check for unused throws. - To allow documented java.lang.RuntimeExceptions that are not declared, set property allowUndeclaredRTE to true. - The scope to verify is specified using the Scope class and defaults to Scope.PRIVATE. - To verify another scope, set property scope to a different scope. - -

Error messages about parameters and type parameters for which no param tags are present can be suppressed by defining property allowMissingParamTags. - Error messages about exceptions which are declared to be thrown, but for which no throws tag is present can be suppressed by defining property allowMissingThrowsTags. - Error messages about methods which return non-void but for which no return tag is present can be suppressed by defining property allowMissingReturnTag. - -

Javadoc is not required on a method that is tagged with the @Override annotation. - However under Java 5 it is not possible to mark a method required for an interface (this was corrected under Java 6). - Hence Checkstyle supports using the convention of using a single {@inheritDoc} tag instead of all the other tags. - -

Note that only inheritable items will allow the {@inheritDoc} tag to be used in place of comments. - Static methods at all visibilities, private non-static methods and constructors are not inheritable. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.html deleted file mode 100644 index d38f7c5a07f..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.html +++ /dev/null @@ -1 +0,0 @@ -

Checks that each Java package has a Javadoc file used for commenting. By default it only allows a package-info.java file, but can be configured to allow a package.html file. An error will be reported if both files exist as this is not allowed by the Javadoc tool.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.html deleted file mode 100644 index 6068def9974..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck.html +++ /dev/null @@ -1,15 +0,0 @@ -Validates Javadoc comments to help ensure they are well formed. The following checks are performed: -
    -
  • Ensures the first sentence ends with proper punctuation (That is a period, question mark, or exclamation mark, by default). - Javadoc automatically places the first sentence in the method summary table and index. With out proper punctuation the Javadoc may be malformed. - All items eligible for the {@inheritDoc} tag are exempt from this requirement.
  • -
  • Check text for Javadoc statements that do not have any description. - This includes both completely empty Javadoc, and Javadoc with only tags such as @param and @return.
  • -
  • Check text for incomplete HTML tags. Verifies that HTML tags have corresponding end tags and issues an "Unclosed HTML tag found:" error if not. - An "Extra HTML tag found:" error is issued if an end tag is found without a previous open tag.
  • -
  • Check that a package Javadoc comment is well-formed (as described above) and NOT missing from any package-info.java files.
  • -
  • Check for allowed HTML tags. The list of allowed HTML tags is "a", "abbr", "acronym", "address", "area", "b", - "bdo", "big", "blockquote", "br", "caption", "cite", "code", "colgroup", "del", "div", "dfn", "dl", "em", "fieldset", - "h1" to "h6", "hr", "i", "img", "ins", "kbd", "li", "ol", "p", "pre", "q", "samp", "small", "span", "strong", - "sub", "sup", "table", "tbody", "td", "tfoot", "th", "thread", "tr", "tt", "ul"
  • -
\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.html deleted file mode 100644 index 4922c34ad02..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.html +++ /dev/null @@ -1,4 +0,0 @@ -Checks Javadoc comments for class and interface definitions. By default, does not check for author or version tags. - The scope to verify is specified using the Scope class and defaults to Scope.PRIVATE. To verify another scope, set property scope to one of the Scope constants. - To define the format for an author tag or a version tag, set property authorFormat or versionFormat respectively to a regular expression. -

Error messages about type parameters for which no param tags are present can be suppressed by defining property allowMissingParamTags. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck.html deleted file mode 100644 index d2a65fdd945..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that a variable has Javadoc comment. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.html deleted file mode 100644 index 85dcadce204..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.html +++ /dev/null @@ -1 +0,0 @@ -Outputs a JavaDoc tag as information. Can be used e.g. with the stylesheets that sort the report by author name. To define the format for a tag, set property tagFormat to a regular expression. This check uses two different severity levels. The normal one is used for reporting when the tag is missing. The additional one (tagSeverity) is used for the level of reporting when the tag exists. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck.html deleted file mode 100644 index ed97da0af43..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck.html +++ /dev/null @@ -1 +0,0 @@ -Restricts nested boolean operators (&&, || and ^) to a specified depth (default = 3). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.ClassDataAbstractionCouplingCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.ClassDataAbstractionCouplingCheck.html deleted file mode 100644 index 6c4ee49e05d..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.ClassDataAbstractionCouplingCheck.html +++ /dev/null @@ -1 +0,0 @@ -This metric measures the number of instantiations of other classes within the given class. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.ClassFanOutComplexityCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.ClassFanOutComplexityCheck.html deleted file mode 100644 index 49f3b963205..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.ClassFanOutComplexityCheck.html +++ /dev/null @@ -1 +0,0 @@ -The number of other classes a given class relies on. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck.html deleted file mode 100644 index 5881a983f4a..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks cyclomatic complexity of methods against a specified limit. The complexity is measured by the number of if, while, do, for, ?:, catch, switch, case statements, and operators && and || (plus one) in the body of a constructor, method, static initializer, or instance initializer. It is a measure of the minimum number of possible paths through the source and therefore the number of required tests. Generally 1-4 is considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now ! \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.html deleted file mode 100644 index 8e5a2f6dde4..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck.html +++ /dev/null @@ -1,6 +0,0 @@ -Determines complexity of methods, classes and files by counting the Non Commenting Source Statements (NCSS). This check adheres to the specification for the JavaNCSS-Tool written by Chr. Clemens Lee. -Rougly said the NCSS metric is calculated by counting the source lines which are not comments, (nearly) equivalent to counting the semicolons and opening curly braces. -The NCSS for a class is summarized from the NCSS of all its methods, the NCSS of its nested classes and the number of member variable declarations. -The NCSS for a file is summarized from the ncss of all its top level classes, the number of imports and the package declaration. -
-Rationale: Too large methods and classes are hard to read and costly to maintain. A large NCSS number often means that a method or class has too many responsabilities and/or functionalities which should be decomposed into smaller units. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck.html deleted file mode 100644 index f9dd54ef4f6..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the npath complexity of a method against a specified limit (default = 200). The NPATH metric computes the number of possible execution paths through a function. It takes into account the nesting of conditional statements and multi-part boolean expressions (e.g., A && B, C || D, etc.). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck.html deleted file mode 100644 index 362988f1378..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that the order of modifiers conforms to the suggestions in the Java Language specification, sections 8.1.1, 8.3.1 and 8.4.3. The correct order is : public, protected, private, abstract, static, final, transient, volatile, synchronized, native, strictfp. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck.html deleted file mode 100644 index 06a83bf2181..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for redundant modifiers in interface and annotation definitions. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.html deleted file mode 100644 index f606382272b..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that abstract class names conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck.html deleted file mode 100644 index ed1cb11d072..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck.html +++ /dev/null @@ -1,12 +0,0 @@ -Checks that class parameter names conform to the specified format - -

-The following code snippet illustrates this rule for format "^[A-Z]$": -

-
-class Something<type> { // Non-compliant
-}
-
-class Something<T> { // Compliant
-}
-
diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.html deleted file mode 100644 index 7fb10ee1911..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that constant names conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck.html deleted file mode 100644 index 1a78aa21462..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that local final variable names, including catch parameters, conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck.html deleted file mode 100644 index b7bba417938..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that local, non-final variable names conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.html deleted file mode 100644 index 0af9b6bfbc4..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that name of non-static fields conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck.html deleted file mode 100644 index ca1d86559e7..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that method names conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck.html deleted file mode 100644 index 19bc06a2273..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck.html +++ /dev/null @@ -1,13 +0,0 @@ -Checks that method type parameter names conform to the specified format - -

-The following code snippet illustrates this rule for format "^[A-Z]$": -

-
-public <type> boolean containsAll(Collection<type> c) { // Non-compliant
-  return null;
-}
-
-public <T> boolean containsAll(Collection<T> c) { // Compliant
-}
-
diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck.html deleted file mode 100644 index 691a67573aa..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck.html +++ /dev/null @@ -1,4 +0,0 @@ -Checks that package names conform to the specified format. The default value of format - has been chosen to match the requirements in the Java Language specification and the Sun coding conventions. - However both underscores and uppercase letters are rather uncommon, so most configurations should probably - assign value ^[a-z]+(\.[a-z][a-z0-9]*)*$ to format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck.html deleted file mode 100644 index fda18854928..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that parameter names conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck.html deleted file mode 100644 index 10d42bd92e1..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that static, non-final fields conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.html deleted file mode 100644 index a69c933905b..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that type names conform to the specified format \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.html deleted file mode 100644 index c9af41ae109..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck.html +++ /dev/null @@ -1 +0,0 @@ -

A check for detecting that matches across multiple lines. Rationale: This check can be used to when the regular expression can be span multiple lines.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.html deleted file mode 100644 index b74a2949b6c..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck.html +++ /dev/null @@ -1 +0,0 @@ -

A check for detecting single lines that match a supplied regular expression. Works with any file type. Rationale: This check can be used to prototype checks and to find common bad practice such as calling ex.printStacktrace(), System.out.println(), System.exit(), etc.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.html deleted file mode 100644 index 1edc27f7fd9..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck.html +++ /dev/null @@ -1 +0,0 @@ -

This class is variation on RegexpSingleline for detecting single lines that match a supplied regular expression in Java files. It supports suppressing matches in Java comments.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck.html deleted file mode 100644 index d38676e87be..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for long anonymous inner classes. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.html deleted file mode 100644 index 5ed9d59908f..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.html +++ /dev/null @@ -1 +0,0 @@ -Restricts the number of executable statements to a specified limit (default = 30). \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck.html deleted file mode 100644 index 69c6d9ae84b..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck.html +++ /dev/null @@ -1,2 +0,0 @@ -

Checks for long source files.

-

Rationale: If a source file becomes very long it is hard to understand. Therefore long classes should usually be refactored into several individual classes that focus on a specific task.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.html deleted file mode 100644 index a7fbe9b709e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for long lines. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.html deleted file mode 100644 index dc9d4c70807..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the number of methods declared in each type. This includes the number of each scope (private, package, protected and public) as well as an overall total. diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck.html deleted file mode 100644 index db84c609730..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks for long methods. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.OuterTypeNumberCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.OuterTypeNumberCheck.html deleted file mode 100644 index 5a5dd601ecc..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.OuterTypeNumberCheck.html +++ /dev/null @@ -1 +0,0 @@ -

Checks for the number of types declared at the outer (or root) level in a file. Rationale: It is considered good practice to only define one outer type per file.

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck.html deleted file mode 100644 index 86cc99dfcd8..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the number of parameters that a method or constructor has. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck.html deleted file mode 100644 index 6617a503734..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the padding of an empty for initializer; that is whether a space is required at an empty for initializer, or such spaces are forbidden. Example : for ( ; i < j; i++, j--) \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.html deleted file mode 100644 index bd5b35259d4..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the padding of an empty for iterator; that is whether a space is required at an empty for iterator, or such spaces are forbidden. Example : for (Iterator foo = very.long.line.iterator(); foo.hasNext(); ) \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.html deleted file mode 100644 index c37dae92e68..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck.html +++ /dev/null @@ -1,5 +0,0 @@ -

Checks that there are no tab characters ('\t') in the source code. Rationale: -

    -
  • Developers should not need to configure the tab width of their text editors in order to be able to read source code.
  • -
  • From the Apache jakarta coding standards: In a distributed development environment, when the commit messages get sent to a mailing list, they are almost impossible to read if you use tabs.
  • -

\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.html deleted file mode 100644 index c39f62ab427..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck.html +++ /dev/null @@ -1,15 +0,0 @@ -

Checks that the whitespace around the Generic tokens < and > is correct to the typical convention. The convention is not configurable.

-

-For example the following is legal: -

-
-  List x = new ArrayList();
-  List> y = new ArrayList>();
-
-

-But the following example is not: -

-
-  List < Integer > x = new ArrayList < Integer > ();
-  List < List < Integer > > y = new ArrayList < List < Integer > > ();
-
\ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.html deleted file mode 100644 index 5d629eb4044..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the padding between the identifier of a method definition, constructor definition, method call, or constructor invocation; and the left parenthesis of the parameter list. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck.html deleted file mode 100644 index ed1fbe0d260..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that there is no whitespace after a token. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck.html deleted file mode 100644 index 54eb8346dc2..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that there is no whitespace before a token. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.html deleted file mode 100644 index bb3a6a72e88..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the policy on how to wrap lines on operators. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck.html deleted file mode 100644 index a78470f2134..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the padding of parentheses; that is whether a space is required after a left parenthesis and before a right parenthesis, or such spaces are forbidden, with the exception that it does not check for padding of the right parenthesis at an empty for iterator. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck.html deleted file mode 100644 index a6b0b96691f..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks the padding of parentheses for typecasts. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.html deleted file mode 100644 index 70c79e42cb2..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that a token is followed by whitespace, with the exception that it does not check for whitespace after the semicolon of an empty for iterator. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.html b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.html deleted file mode 100644 index fd9166cf48b..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/l10n/checkstyle/rules/checkstyle/com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck.html +++ /dev/null @@ -1 +0,0 @@ -Checks that a token is surrounded by whitespace. \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/checkstyle-plugin.properties b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/checkstyle-plugin.properties deleted file mode 100644 index aa13c64e80a..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/checkstyle-plugin.properties +++ /dev/null @@ -1 +0,0 @@ -checkstyle.version=${checkstyle.version} diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/profile-sonar-way.xml b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/profile-sonar-way.xml deleted file mode 100644 index 70b881c4b26..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/profile-sonar-way.xml +++ /dev/null @@ -1,158 +0,0 @@ - - Sonar way - java - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck - - - tokens - VARIABLE_DEF - - - ignoreConstructorParameter - true - - - ignoreSetter - true - - - ignoreAbstractMethods - true - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck - - - max - 10 - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck - - - diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/profile-sun-conventions.xml b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/profile-sun-conventions.xml deleted file mode 100644 index 75e32602b29..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/profile-sun-conventions.xml +++ /dev/null @@ -1,625 +0,0 @@ - - Sun checks - java - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck - - - lineSeparator - system - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck - - - tokens - COMMA,SEMI,TYPECAST - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.UpperEllCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck - - - tokens - CTOR_CALL,LPAREN,METHOD_CALL,RPAREN,SUPER_CTOR_CALL - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck - - - tokens - LITERAL_DO,LITERAL_ELSE,LITERAL_IF,LITERAL_FOR,LITERAL_WHILE - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck - - - format - ^[a-z][a-zA-Z0-9]*$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck - - - format - ^[a-z][a-zA-Z0-9]*$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck - - - allowUndeclaredRTE - false - - - allowThrowsTagsForSubclasses - false - - - allowMissingParamTags - false - - - allowMissingThrowsTags - false - - - allowMissingReturnTag - false - - - allowMissingJavadoc - false - - - allowMissingPropertyJavadoc - false - - - tokens - METHOD_DEF,CTOR_DEF - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck - - - tokens - METHOD_DEF,CTOR_DEF - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck - - - tokens - - LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_IF,LITERAL_FOR,LITERAL_TRY,LITERAL_WHILE,INSTANCE_INIT,STATIC_INIT - - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck - - - format - TODO: - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck - - - max - 2000 - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck - - - max - 7 - - - tokens - METHOD_DEF,CTOR_DEF - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck - - - tokens - METHOD_DEF,VARIABLE_DEF,ANNOTATION_FIELD_DEF - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck - - - allowUnchecked - false - - - allowSubclasses - false - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck - - - tokens - TYPECAST,RPAREN - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck - - - ignorePattern - ^$ - - - max - 80 - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck - - - tokens - - ASSIGN,BAND_ASSIGN,BOR_ASSIGN,BSR_ASSIGN,BXOR_ASSIGN,DIV_ASSIGN,MINUS_ASSIGN,MOD_ASSIGN,PLUS_ASSIGN,SL_ASSIGN,SR_ASSIGN,STAR_ASSIGN - - - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck - - - option - nl - - - tokens - - BAND,BOR,BSR,BXOR,COLON,DIV,EQUAL,GE,GT,LAND,LE,LITERAL_INSTANCEOF,LOR,LT,MINUS,MOD,NOT_EQUAL,PLUS,QUESTION,SL,SR,STAR - - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck - - - format - ^[a-z][a-zA-Z0-9]*$ - - - applyToPublic - true - - - applyToProtected - true - - - applyToPackage - true - - - applyToPrivate - true - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck - - - tokens - LITERAL_TRY,LITERAL_CATCH,LITERAL_FINALLY,LITERAL_IF,LITERAL_ELSE - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck - - - format - ^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck - - - format - ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck - - - format - ^[A-Z][a-zA-Z0-9]*$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck - - - max - 150 - - - countEmpty - true - - - tokens - METHOD_DEF,CTOR_DEF - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck - - - format - ^[a-z][a-zA-Z0-9]*$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck - - - allowMissingParamTags - false - - - tokens - INTERFACE_DEF,CLASS_DEF - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck - - - checkFirstSentence - true - - - checkEmptyJavadoc - false - - - checkHtml - true - - - tokens - INTERFACE_DEF,CLASS_DEF,METHOD_DEF,CTOR_DEF,VARIABLE_DEF - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck - - - allowMarkerInterfaces - true - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck - - - tokens - PARAMETER_DEF,VARIABLE_DEF - - - ignoreConstructorParameter - false - - - ignoreSetter - false - - - ignoreAbstractMethods - false - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck - - - allowLineBreaks - true - - - tokens - ARRAY_INIT,BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck - - - option - eol - - - maxLineLength - 80 - - - tokens - - CLASS_DEF,CTOR_DEF,INTERFACE_DEF,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_SWITCH,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,METHOD_DEF - - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck - - - packageAllowed - false - - - protectedAllowed - false - - - publicMemberPattern - ^serialVersionUID$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck - - - format - ^[a-z][a-zA-Z0-9]*$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck - - - allowLineBreaks - false - - - tokens - SEMI,POST_DEC,POST_INC - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck - - - allowLineBreaks - false - - - tokens - CTOR_DEF,LITERAL_NEW,METHOD_CALL,METHOD_DEF,SUPER_CTOR_CALL - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck - - - tokens - NUM_DOUBLE,NUM_FLOAT,NUM_INT,NUM_LONG - - - ignoreNumbers - -1,0,1,2 - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck - - - format - ^[a-z][a-zA-Z0-9]*$ - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck - - - allowInSwitchCase - false - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck - - - tokens - - ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,GENERIC_START,GENERIC_END,TYPE_EXTENSION_AND,WILDCARD_TYPE - - - - allowEmptyConstructors - false - - - allowEmptyMethods - false - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck - - - javaStyle - true - - - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck - - - checkstyle - com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck - - - diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml deleted file mode 100644 index 4d48d0cdc49..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml +++ /dev/null @@ -1,1313 +0,0 @@ - - - - com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck - MAJOR - Checker/Header - - header - s - - - ignoreLines - s - - - - - com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck - MAJOR - - - - header - s - - - multiLines - s - - - - - MAJOR - - - - - - - - - - - - MAJOR - - - - - - MAJOR - - - - - - - - MINOR - - - - - - MAJOR - - - - - - - - - - MAJOR - - - - false - - - - - MAJOR - - - - - - MAJOR - - - - - - MINOR - - - - - - - - MINOR - - - - - - - - MAJOR - - - MULTIPLE - - - - - - - - - - - - - - MAJOR - - - MULTIPLE - - - - - - - - - - - - - - MAJOR - - - MULTIPLE - - - - - - - - - - - - - - - - MINOR - - - - - - - - MINOR - - - - - - - - MINOR - - - - - - MAJOR - - - - - - - - - - - - MINOR - - - - - - MAJOR - - - - ^Abstract.*$|^.*Factory$ - - - false - - - false - - - - - MAJOR - - - - - - - - MAJOR - - - - - - MINOR - - - - - - - - MINOR - - - - - - MAJOR - - - - - - - - MINOR - - - - - - false - - - false - - - - - MAJOR - - - - - - - - - - MAJOR - - - - - - - - MAJOR - - - - - - - - MINOR - - - MULTIPLE - - ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ - - - true - - - true - - - true - - - true - - - - - CRITICAL - - - - - - MAJOR - - - - - - - - INFO - - - - - - - - - MAJOR - - - - - - MINOR - - - - - - MAJOR - - - - - - - - - - MINOR - - - - - - - - MINOR - - - - - - - - MINOR - - - - - - CRITICAL - - - - - - MAJOR - - - - - - - - - - MAJOR - - - - - - MAJOR - - - - - - - - - - MAJOR - - - - - - - - MAJOR - - - - - - MINOR - - - - - - - - MINOR - - - - - - - - MAJOR - - - - - - - - - - - - - - - - MAJOR - - - - - - MAJOR - - - - - - - - MAJOR - - - - - - - - MAJOR - - - - - - - - MAJOR - - - - - - - - - - MAJOR - - - - - - - - MAJOR - - - MULTIPLE - - - - - - - - - - - - MAJOR - - - - - - - - - - - - - - - - MINOR - - - - - - - - - - - - - - - - MINOR - - - - 4 - - - 0 - - - 4 - - - 8 - - - - - MAJOR - - - - - - - - MAJOR - - - - - - - - MAJOR - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - MAJOR - - - - - - - - - - - - - - - - - - MAJOR - - - - - - - - - - - - - - - - - - - - MAJOR - - - - - - - - - - MINOR - - - - - - - - - - - - MAJOR - - - - - - - - - - - - MAJOR - - - - ^[a-z][a-zA-Z0-9]*$ - - - - - MAJOR - MULTIPLE - - - - ^[a-z][a-zA-Z0-9]*$ - - - - - - - MINOR - - - - - - - - false - - - false - - - - - MAJOR - MULTIPLE - - - - ^[a-z][a-zA-Z0-9]*$ - - - true - - - true - - - true - - - true - - - - - MAJOR - - - - - - - - - - - - MAJOR - - - - ^[a-z][a-zA-Z0-9]*$ - - - false - - - - - MAJOR - - - - - - - - - - - - MAJOR - - - - - - MAJOR - - - - - - MAJOR - - - - - - MINOR - - - - - - MAJOR - - - MULTIPLE - - - - - - - - - - MAJOR - - - - - - MAJOR - - - - - - - - MAJOR - - - - - - - - MINOR - - - - - - - - MAJOR - - - - - - - - MAJOR - - - - - - - - MINOR - - - - - - - - - - MINOR - - - - - - - - - - MINOR - - - - - - - - - - MINOR - - - - - - - - - - MAJOR - - - - - - - MAJOR - - - - ^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$ - - - - - MAJOR - - - - - - MAJOR - - - - ^[a-z][a-zA-Z0-9]*$ - - - - - MAJOR - - - MULTIPLE - - - - - - - MINOR - - - - - - - - - - MINOR - - - - - - - - MINOR - - - - - - - - - true - - - - - MAJOR - - - MULTIPLE - - - - - - - - - - - - - - - - MAJOR - - - - - - - - - - MAJOR - - - - - - - - - - MINOR - - - - - - - - - - MAJOR - - - - - - MAJOR - - - - - - MAJOR - - - MULTIPLE - - ^[a-z][a-zA-Z0-9]*$ - - - true - - - true - - - true - - - true - - - - - MAJOR - - - - - - - - - - MAJOR - - - - - - MAJOR - - - - - - MAJOR - - - - - - MAJOR - - - - - - - - MINOR - - - MULTIPLE - - - - - - MINOR - - - - ^[\s\}\);]*$ - - - - - - - - - MAJOR - - - MULTIPLE - - ^[A-Z][a-zA-Z0-9]*$ - - - - - true - - - true - - - true - - - true - - - - - MAJOR - - - - - - - - - - MAJOR - - - - - - - - MINOR - - - - - - INFO - - - - false - - - - - MINOR - - - - - - MAJOR - - - - - - - - - - - - MINOR - - - - - - - - MINOR - - - - - - - - - - - - MINOR - - - - - - - - - - - - INFO - - - - - - MAJOR - - - - - - MAJOR - - - - 1 - - - - - MAJOR - - - - 100 - - - 100 - - - 100 - - - 100 - - - 100 - - - - - MAJOR - - - - - - MAJOR - - - - ^[A-Z]$ - - - - - MAJOR - - - - ^[A-Z]$ - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleAuditListenerTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleAuditListenerTest.java deleted file mode 100644 index f0dd03a6965..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleAuditListenerTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.nullValue; -import static org.junit.Assert.assertThat; - -import com.puppycrawl.tools.checkstyle.api.AuditEvent; -import com.puppycrawl.tools.checkstyle.api.LocalizedMessage; -import org.junit.Test; - -public class CheckstyleAuditListenerTest { - @Test - public void testUtilityMethods() { - AuditEvent event; - - event = new AuditEvent(this, "", new LocalizedMessage(0, "", "", null, "", CheckstyleAuditListenerTest.class, "msg")); - assertThat(CheckstyleAuditListener.getLineId(event), nullValue()); - assertThat(CheckstyleAuditListener.getMessage(event), is("msg")); - assertThat(CheckstyleAuditListener.getRuleKey(event), is(CheckstyleAuditListenerTest.class.getName())); - - event = new AuditEvent(this, "", new LocalizedMessage(1, "", "", null, "", CheckstyleAuditListenerTest.class, "msg")); - assertThat(CheckstyleAuditListener.getLineId(event), is(1)); - assertThat(CheckstyleAuditListener.getMessage(event), is("msg")); - assertThat(CheckstyleAuditListener.getRuleKey(event), is(CheckstyleAuditListenerTest.class.getName())); - - event = new AuditEvent(this); - assertThat(CheckstyleAuditListener.getLineId(event), nullValue()); - assertThat(CheckstyleAuditListener.getMessage(event), nullValue()); - assertThat(CheckstyleAuditListener.getRuleKey(event), nullValue()); - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest.java deleted file mode 100644 index 69831487119..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.apache.commons.io.FileUtils; -import org.junit.Test; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.resources.Project; -import org.sonar.api.test.MavenTestUtils; - -import java.io.File; -import java.io.IOException; -import java.io.Writer; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; - -public class CheckstyleConfigurationTest { - - @Test - public void writeConfigurationToWorkingDir() throws IOException { - Project project = MavenTestUtils.loadProjectFromPom(getClass(), "writeConfigurationToWorkingDir/pom.xml"); - - CheckstyleProfileExporter exporter = new FakeExporter(); - CheckstyleConfiguration configuration = new CheckstyleConfiguration(null, exporter, null, project.getFileSystem()); - File xmlFile = configuration.getXMLDefinitionFile(); - - assertThat(xmlFile.exists(), is(true)); - assertThat(FileUtils.readFileToString(xmlFile), is("")); - } - - public class FakeExporter extends CheckstyleProfileExporter { - @Override - public void exportProfile(RulesProfile profile, Writer writer) { - try { - writer.write(""); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - } - -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleExecutorTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleExecutorTest.java deleted file mode 100644 index 6f7f320aa71..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleExecutorTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import com.puppycrawl.tools.checkstyle.api.AuditEvent; -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringUtils; -import org.hamcrest.BaseMatcher; -import org.junit.Test; -import org.mockito.ArgumentMatcher; - -import java.io.File; -import java.nio.charset.Charset; -import java.util.Arrays; -import java.util.Locale; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import static org.junit.internal.matchers.StringContains.containsString; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.argThat; -import static org.mockito.Mockito.atLeast; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public class CheckstyleExecutorTest { - - @Test - public void execute() throws Exception { - CheckstyleConfiguration conf = mockConf(); - CheckstyleAuditListener listener = mockListener(); - CheckstyleExecutor executor = new CheckstyleExecutor(conf, listener, getClass().getClassLoader()); - executor.execute(); - - verify(listener, times(1)).auditStarted(any(AuditEvent.class)); - verify(listener, times(1)).auditFinished(any(AuditEvent.class)); - verify(listener, times(1)).fileStarted(argThat(newFilenameMatcher("Hello.java"))); - verify(listener, times(1)).fileFinished(argThat(newFilenameMatcher("Hello.java"))); - verify(listener, times(1)).fileStarted(argThat(newFilenameMatcher("World.java"))); - verify(listener, times(1)).fileFinished(argThat(newFilenameMatcher("World.java"))); - verify(listener, atLeast(1)).addError(argThat(newErrorMatcher("Hello.java", "com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck"))); - } - - @Test - public void canGenerateXMLReport() throws Exception { - CheckstyleConfiguration conf = mockConf(); - File report = new File("target/test-tmp/checkstyle-report.xml"); - when(conf.getTargetXMLReport()).thenReturn(report); - CheckstyleAuditListener listener = mockListener(); - CheckstyleExecutor executor = new CheckstyleExecutor(conf, listener, getClass().getClassLoader()); - executor.execute(); - - assertThat(report.exists(), is(true)); - assertThat(FileUtils.readFileToString(report), containsString(" newErrorMatcher(final String filename, final String rule) { - return new ArgumentMatcher() { - @Override - public boolean matches(Object o) { - AuditEvent event = (AuditEvent) o; - return StringUtils.endsWith(event.getFileName(), filename) && StringUtils.equals(event.getSourceName(), rule); - } - }; - } - - private BaseMatcher newFilenameMatcher(final String filename) { - return new ArgumentMatcher() { - @Override - public boolean matches(Object o) { - AuditEvent event = (AuditEvent) o; - return StringUtils.endsWith(event.getFileName(), filename); - } - }; - } - - private CheckstyleAuditListener mockListener() { - return mock(CheckstyleAuditListener.class); - } - - private CheckstyleConfiguration mockConf() throws Exception { - CheckstyleConfiguration conf = mock(CheckstyleConfiguration.class); - when(conf.getCharset()).thenReturn(Charset.defaultCharset()); - when(conf.getCheckstyleConfiguration()).thenReturn(CheckstyleConfiguration.toCheckstyleConfiguration(new File("test-resources/checkstyle-conf.xml"))); - when(conf.getSourceFiles()).thenReturn(Arrays. asList(new File("test-resources/Hello.java"), new File("test-resources/World.java"))); - when(conf.getLocale()).thenReturn(Locale.ENGLISH); - return conf; - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstylePluginTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstylePluginTest.java deleted file mode 100644 index fe0f2e552aa..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstylePluginTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import static org.hamcrest.number.OrderingComparisons.greaterThan; -import static org.junit.Assert.assertThat; - -import org.junit.Test; - -public class CheckstylePluginTest { - - @Test - public void testGetExtensions() { - CheckstylePlugin plugin = new CheckstylePlugin(); - assertThat(plugin.getExtensions().size(), greaterThan(1)); - } - -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest.java deleted file mode 100644 index 4de15b2b4bc..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.apache.commons.configuration.BaseConfiguration; -import org.apache.commons.configuration.Configuration; -import org.apache.commons.lang.StringUtils; -import org.junit.Test; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RulePriority; -import org.sonar.test.TestUtils; -import org.xml.sax.SAXException; - -import java.io.IOException; -import java.io.StringWriter; - -public class CheckstyleProfileExporterTest { - - @Test - public void alwaysSetFileContentsHolderAndSuppressionCommentFilter() throws IOException, SAXException { - RulesProfile profile = RulesProfile.create("sonar way", "java"); - - StringWriter writer = new StringWriter(); - new CheckstyleProfileExporter().exportProfile(profile, writer); - - TestUtils.assertSimilarXml( - TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/alwaysSetFileContentsHolderAndSuppressionCommentFilter.xml"), - sanitizeForTests(writer.toString())); - } - @Test - public void noCheckstyleRulesToExport() throws IOException, SAXException { - RulesProfile profile = RulesProfile.create("sonar way", "java"); - - // this is a PMD rule - profile.activateRule(Rule.create("pmd", "PmdRule1", "PMD rule one"), null); - - StringWriter writer = new StringWriter(); - new CheckstyleProfileExporter().exportProfile(profile, writer); - - TestUtils.assertSimilarXml( - TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/noCheckstyleRulesToExport.xml"), - sanitizeForTests(writer.toString())); - } - - @Test - public void singleCheckstyleRulesToExport() throws IOException, SAXException { - RulesProfile profile = RulesProfile.create("sonar way", "java"); - profile.activateRule(Rule.create("pmd", "PmdRule1", "PMD rule one"), null); - profile.activateRule( - Rule.create("checkstyle", "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck", "Javadoc").setConfigKey("Checker/JavadocPackage"), - RulePriority.MAJOR - ); - profile.activateRule(Rule.create("checkstyle", "com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck", "Line Length").setConfigKey("Checker/TreeWalker/LineLength"), - RulePriority.CRITICAL); - profile.activateRule(Rule.create("checkstyle", "com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck", "Local Variable").setConfigKey("Checker/TreeWalker/Checker/TreeWalker/LocalFinalVariableName"), - RulePriority.MINOR); - - StringWriter writer = new StringWriter(); - new CheckstyleProfileExporter().exportProfile(profile, writer); - - TestUtils.assertSimilarXml( - TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/singleCheckstyleRulesToExport.xml"), - sanitizeForTests(writer.toString())); - } - - @Test - public void addTheIdPropertyWhenManyInstancesWithTheSameConfigKey() throws IOException, SAXException { - RulesProfile profile = RulesProfile.create("sonar way", "java"); - Rule rule1 = Rule.create("checkstyle", "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck", "Javadoc").setConfigKey("Checker/JavadocPackage"); - Rule rule2 = Rule.create("checkstyle", "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck_12345", "Javadoc").setConfigKey("Checker/JavadocPackage").setParent(rule1); - - profile.activateRule(rule1, RulePriority.MAJOR); - profile.activateRule(rule2, RulePriority.CRITICAL); - - StringWriter writer = new StringWriter(); - new CheckstyleProfileExporter().exportProfile(profile, writer); - - TestUtils.assertSimilarXml( - TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/addTheIdPropertyWhenManyInstancesWithTheSameConfigKey.xml"), - sanitizeForTests(writer.toString())); - } - - @Test - public void exportParameters() throws IOException, SAXException { - RulesProfile profile = RulesProfile.create("sonar way", "java"); - Rule rule = Rule.create("checkstyle", "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck", "Javadoc") - .setConfigKey("Checker/JavadocPackage"); - rule.createParameter("format"); - rule.createParameter("message"); // not set in the profile and no default value => not exported in checkstyle - rule.createParameter("ignore"); - - profile.activateRule(rule, RulePriority.MAJOR) - .setParameter("format", "abcde"); - - StringWriter writer = new StringWriter(); - new CheckstyleProfileExporter().exportProfile(profile, writer); - - TestUtils.assertSimilarXml( - TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml"), - sanitizeForTests(writer.toString())); - } - - - @Test - public void addCustomFilters() throws IOException, SAXException { - Configuration conf = new BaseConfiguration(); - conf.addProperty(CheckstyleConstants.FILTERS_KEY, - "" - + "" - + "" + "" - +"" - + "" - + "" - + "" - + ""); - - RulesProfile profile = RulesProfile.create("sonar way", "java"); - StringWriter writer = new StringWriter(); - new CheckstyleProfileExporter(conf).exportProfile(profile, writer); - - TestUtils.assertSimilarXml( - TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/addCustomFilters.xml"), - sanitizeForTests(writer.toString())); - } - - - private static String sanitizeForTests(String xml) { - // remove the doctype declaration, else the unit test fails when executed offline - return StringUtils.remove(xml, CheckstyleProfileExporter.DOCTYPE_DECLARATION); - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest.java deleted file mode 100644 index 61f89285662..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.apache.commons.lang.StringUtils; -import org.junit.Before; -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.rules.ActiveRule; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleFinder; -import org.sonar.api.rules.RulePriority; -import org.sonar.api.rules.RuleQuery; -import org.sonar.api.utils.ValidationMessages; -import org.sonar.test.TestUtils; - -import java.io.Reader; -import java.io.StringReader; - -import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsNull.nullValue; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class CheckstyleProfileImporterTest { - - private ValidationMessages messages; - private CheckstyleProfileImporter importer; - - @Before - public void before() { - messages = ValidationMessages.create(); - - /* - * The mocked rule finder defines 2 rules : - * - * - JavadocCheck with 2 paramters format and ignore, default priority is MAJOR - * - EqualsHashCodeCheck without parameters, default priority is BLOCKER - */ - importer = new CheckstyleProfileImporter(newRuleFinder()); - } - - @Test - public void importSimpleProfile() { - Reader reader = new StringReader(TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/simple.xml")); - RulesProfile profile = importer.importProfile(reader, messages); - - assertThat(profile.getActiveRules().size(), is(2)); - assertNotNull(profile.getActiveRuleByConfigKey("checkstyle", "Checker/TreeWalker/EqualsHashCode")); - assertNotNull(profile.getActiveRuleByConfigKey("checkstyle", "Checker/JavadocPackage")); - assertThat(messages.hasErrors(), is(false)); - } - - @Test - public void importParameters() { - Reader reader = new StringReader(TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/simple.xml")); - RulesProfile profile = importer.importProfile(reader, messages); - - ActiveRule javadocCheck = profile.getActiveRuleByConfigKey("checkstyle", "Checker/JavadocPackage"); - assertThat(javadocCheck.getActiveRuleParams().size(), is(2)); - assertThat(javadocCheck.getParameter("format"), is("abcde")); - assertThat(javadocCheck.getParameter("ignore"), is("true")); - assertThat(javadocCheck.getParameter("severity"), nullValue()); // checkstyle internal parameter - } - - @Test - public void importPriorities() { - Reader reader = new StringReader(TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/simple.xml")); - RulesProfile profile = importer.importProfile(reader, messages); - - ActiveRule javadocCheck = profile.getActiveRuleByConfigKey("checkstyle", "Checker/JavadocPackage"); - assertThat(javadocCheck.getSeverity(), is(RulePriority.BLOCKER)); - } - - @Test - public void priorityIsOptional() { - Reader reader = new StringReader(TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/simple.xml")); - RulesProfile profile = importer.importProfile(reader, messages); - - ActiveRule activeRule = profile.getActiveRuleByConfigKey("checkstyle", "Checker/TreeWalker/EqualsHashCode"); - assertThat(activeRule.getSeverity(), is(RulePriority.BLOCKER)); // reuse the rule default priority - } - - @Test - public void idPropertyShouldBeTheRuleKey() { - Reader reader = new StringReader(TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/idPropertyShouldBeTheRuleKey.xml")); - RulesProfile profile = importer.importProfile(reader, messages); - - assertNull(profile.getActiveRuleByConfigKey("checkstyle", "Checker/JavadocPackage")); - assertThat(messages.getWarnings().size(), is(1)); - } - - @Test - public void shouldUseTheIdPropertyToFindRule() { - Reader reader = new StringReader(TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/shouldUseTheIdPropertyToFindRule.xml")); - RulesProfile profile = importer.importProfile(reader, messages); - - assertNotNull(profile.getActiveRuleByConfigKey("checkstyle", "Checker/JavadocPackage")); - assertThat(profile.getActiveRuleByConfigKey("checkstyle", "Checker/JavadocPackage").getRule().getKey(), - is("com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck_12345")); - assertThat(messages.getWarnings().size(), is(0)); - } - - @Test - public void testUnvalidXML() { - Reader reader = new StringReader("not xml"); - importer.importProfile(reader, messages); - assertThat(messages.getErrors().size(), is(1)); - } - - @Test - public void importingFiltersIsNotSupported() { - Reader reader = new StringReader(TestUtils.getResourceContent("/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/importingFiltersIsNotSupported.xml")); - RulesProfile profile = importer.importProfile(reader, messages); - - assertNull(profile.getActiveRuleByConfigKey("checkstyle", "Checker/SuppressionCommentFilter")); - assertNull(profile.getActiveRuleByConfigKey("checkstyle", "Checker/TreeWalker/FileContentsHolder")); - assertThat(profile.getActiveRules().size(), is(2)); - assertThat(messages.getWarnings().size(), is(1)); // no warning for FileContentsHolder - } - - private RuleFinder newRuleFinder() { - RuleFinder ruleFinder = mock(RuleFinder.class); - when(ruleFinder.find(any(RuleQuery.class))).thenAnswer(new Answer() { - public Rule answer(InvocationOnMock iom) throws Throwable { - RuleQuery query = (RuleQuery) iom.getArguments()[0]; - Rule rule = null; - if (StringUtils.equals(query.getConfigKey(), "Checker/JavadocPackage")) { - rule = Rule.create(query.getRepositoryKey(), "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck", "Javadoc Package") - .setConfigKey("Checker/JavadocPackage") - .setSeverity(RulePriority.MAJOR); - rule.createParameter("format"); - rule.createParameter("ignore"); - - } else if (StringUtils.equals(query.getConfigKey(), "Checker/TreeWalker/EqualsHashCode")) { - rule = Rule.create(query.getRepositoryKey(), "com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck", "Equals HashCode") - .setConfigKey("Checker/TreeWalker/EqualsHashCode") - .setSeverity(RulePriority.BLOCKER); - - } else if (StringUtils.equals(query.getKey(), "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck_12345")) { - rule = Rule.create(query.getRepositoryKey(), "com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck_12345", "Javadoc Package") - .setConfigKey("Checker/JavadocPackage") - .setSeverity(RulePriority.MAJOR); - rule.createParameter("format"); - rule.createParameter("ignore"); - } - return rule; - } - }); - return ruleFinder; - } - -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleRuleRepositoryTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleRuleRepositoryTest.java deleted file mode 100644 index 387815fe9bb..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleRuleRepositoryTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.junit.Before; -import org.junit.Test; -import org.sonar.api.platform.ServerFileSystem; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.XMLRuleParser; -import org.sonar.test.i18n.RuleRepositoryTestHelper; - -import java.util.List; - -import static org.fest.assertions.Assertions.assertThat; -import static org.mockito.Mockito.mock; - -public class CheckstyleRuleRepositoryTest { - CheckstyleRuleRepository repository; - - @Before - public void setUpRuleRepository() { - repository = new CheckstyleRuleRepository(mock(ServerFileSystem.class), new XMLRuleParser()); - } - - @Test - public void loadRepositoryFromXml() { - List rules = repository.createRules(); - - assertThat(repository.getKey()).isEqualTo("checkstyle"); - assertThat(rules.size()).isEqualTo(128); - } - - @Test - public void should_provide_a_name_and_description_for_each_rule() { - List rules = RuleRepositoryTestHelper.createRulesWithNameAndDescription("checkstyle", repository); - - assertThat(rules).onProperty("name").excludes(null, ""); - assertThat(rules).onProperty("description").excludes(null, ""); - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleSeverityUtilsTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleSeverityUtilsTest.java deleted file mode 100644 index 7d920fdbdd8..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleSeverityUtilsTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.junit.Test; -import org.sonar.api.rules.RulePriority; - -import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsNull.nullValue; -import static org.junit.Assert.assertThat; - -public class CheckstyleSeverityUtilsTest { - - @Test - public void testToSeverity() { - assertThat(CheckstyleSeverityUtils.toSeverity(RulePriority.BLOCKER), is("error")); - assertThat(CheckstyleSeverityUtils.toSeverity(RulePriority.CRITICAL), is("error")); - assertThat(CheckstyleSeverityUtils.toSeverity(RulePriority.MAJOR), is("warning")); - assertThat(CheckstyleSeverityUtils.toSeverity(RulePriority.MINOR), is("info")); - assertThat(CheckstyleSeverityUtils.toSeverity(RulePriority.INFO), is("info")); - } - - @Test - public void testFromSeverity() { - assertThat(CheckstyleSeverityUtils.fromSeverity("error"), is(RulePriority.BLOCKER)); - assertThat(CheckstyleSeverityUtils.fromSeverity("warning"), is(RulePriority.MAJOR)); - assertThat(CheckstyleSeverityUtils.fromSeverity("info"), is(RulePriority.INFO)); - assertThat(CheckstyleSeverityUtils.fromSeverity(""), nullValue()); - } -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleVersionTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleVersionTest.java deleted file mode 100644 index 838430c3738..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleVersionTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.junit.Test; - -import static org.hamcrest.number.OrderingComparisons.greaterThan; -import static org.junit.Assert.assertThat; - -public class CheckstyleVersionTest { - - @Test - public void getCheckstyleVersion() { - assertThat(CheckstyleVersion.getVersion().length(), greaterThan(1)); - } - - -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayProfileTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayProfileTest.java deleted file mode 100644 index 29c69ed9244..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayProfileTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.sonar.api.measures.MetricFinder; -import org.sonar.api.profiles.ProfileDefinition; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.profiles.XMLProfileParser; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleFinder; -import org.sonar.api.utils.ValidationMessages; - -import static org.fest.assertions.Assertions.assertThat; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class SonarWayProfileTest { - - @Test - public void shouldCreateProfile() { - ProfileDefinition sonarWay = new SonarWayProfile(new XMLProfileParser(newRuleFinder(), mock(MetricFinder.class))); - ValidationMessages validation = ValidationMessages.create(); - RulesProfile profile = sonarWay.createProfile(validation); - assertThat(profile.getActiveRulesByRepository(CheckstyleConstants.REPOSITORY_KEY).size()).isEqualTo(32); - assertThat(validation.hasErrors()).isFalse(); - } - - private RuleFinder newRuleFinder() { - RuleFinder ruleFinder = mock(RuleFinder.class); - when(ruleFinder.findByKey(anyString(), anyString())).thenAnswer(new Answer() { - public Rule answer(InvocationOnMock iom) throws Throwable { - return Rule.create((String) iom.getArguments()[0], (String) iom.getArguments()[1], (String) iom.getArguments()[1]); - } - }); - return ruleFinder; - } - -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfileTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfileTest.java deleted file mode 100644 index 3e31c8cb497..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfileTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.sonar.api.measures.MetricFinder; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.profiles.XMLProfileParser; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleFinder; -import org.sonar.api.utils.ValidationMessages; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class SonarWayWithFindbugsProfileTest { - - @Test - public void shouldBeSameAsSonarWay() { - RuleFinder ruleFinder = newRuleFinder(); - SonarWayProfile sonarWay = new SonarWayProfile(new XMLProfileParser(ruleFinder, mock(MetricFinder.class))); - RulesProfile withoutFindbugs = sonarWay.createProfile(ValidationMessages.create()); - RulesProfile withFindbugs = new SonarWayWithFindbugsProfile(sonarWay).createProfile(ValidationMessages.create()); - assertThat(withFindbugs.getActiveRules().size(), is(withoutFindbugs.getActiveRules().size())); - assertThat(withFindbugs.getName(), is(RulesProfile.SONAR_WAY_FINDBUGS_NAME)); - } - - private RuleFinder newRuleFinder() { - RuleFinder ruleFinder = mock(RuleFinder.class); - when(ruleFinder.findByKey(anyString(), anyString())).thenAnswer(new Answer() { - public Rule answer(InvocationOnMock iom) throws Throwable { - return Rule.create((String) iom.getArguments()[0], (String) iom.getArguments()[1], (String) iom.getArguments()[1]); - } - }); - return ruleFinder; - } - -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SunConventionsProfileTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SunConventionsProfileTest.java deleted file mode 100644 index 6ec39c4933f..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SunConventionsProfileTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.checkstyle; - -import org.junit.Test; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.sonar.api.measures.MetricFinder; -import org.sonar.api.profiles.ProfileDefinition; -import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.profiles.XMLProfileParser; -import org.sonar.api.rules.Rule; -import org.sonar.api.rules.RuleFinder; -import org.sonar.api.utils.ValidationMessages; - -import static org.fest.assertions.Assertions.assertThat; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class SunConventionsProfileTest { - - @Test - public void shouldCreateProfile() { - ProfileDefinition definition = new SunConventionsProfile(new XMLProfileParser(newRuleFinder(), mock(MetricFinder.class))); - ValidationMessages validation = ValidationMessages.create(); - RulesProfile sunProfile = definition.createProfile(validation); - assertThat(sunProfile.getActiveRulesByRepository(CheckstyleConstants.REPOSITORY_KEY).size()).isEqualTo(58); - assertThat(validation.hasErrors()).isFalse(); - } - - private RuleFinder newRuleFinder() { - RuleFinder ruleFinder = mock(RuleFinder.class); - when(ruleFinder.findByKey(anyString(), anyString())).thenAnswer(new Answer() { - public Rule answer(InvocationOnMock iom) throws Throwable { - return Rule.create((String) iom.getArguments()[0], (String) iom.getArguments()[1], (String) iom.getArguments()[1]); - } - }); - return ruleFinder; - } - -} diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/failIfConfigurationToReuseDoesNotExist/pom.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/failIfConfigurationToReuseDoesNotExist/pom.xml deleted file mode 100644 index 7c63bf8a911..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/failIfConfigurationToReuseDoesNotExist/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - 4.0.0 - fake.group - fake.artifactId - jar - 1.0-SNAPSHOT - - - true - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - does/not/exist/checkstyle.xml - - - - - \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/findConfigurationToReuse/checkstyle.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/findConfigurationToReuse/checkstyle.xml deleted file mode 100644 index 723c9eb7043..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/findConfigurationToReuse/checkstyle.xml +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/findConfigurationToReuse/pom.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/findConfigurationToReuse/pom.xml deleted file mode 100644 index 90f0ad5900e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/findConfigurationToReuse/pom.xml +++ /dev/null @@ -1,25 +0,0 @@ - - 4.0.0 - fake.group - fake.artifactId - jar - 1.0-SNAPSHOT - - - true - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/findConfigurationToReuse/checkstyle.xml - - - - - \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/writeConfigurationToWorkingDir/pom.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/writeConfigurationToWorkingDir/pom.xml deleted file mode 100644 index b4e9f41a04c..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleConfigurationTest/writeConfigurationToWorkingDir/pom.xml +++ /dev/null @@ -1,8 +0,0 @@ - - 4.0.0 - fake.group - fake.artifactId - jar - 1.0-SNAPSHOT - \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/addCustomFilters.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/addCustomFilters.xml deleted file mode 100644 index b1448715645..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/addCustomFilters.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/addTheIdPropertyWhenManyInstancesWithTheSameConfigKey.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/addTheIdPropertyWhenManyInstancesWithTheSameConfigKey.xml deleted file mode 100644 index 7b6fcef7cc9..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/addTheIdPropertyWhenManyInstancesWithTheSameConfigKey.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/alwaysSetFileContentsHolderAndSuppressionCommentFilter.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/alwaysSetFileContentsHolderAndSuppressionCommentFilter.xml deleted file mode 100644 index 2bf36d98d88..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/alwaysSetFileContentsHolderAndSuppressionCommentFilter.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml deleted file mode 100644 index 07537f2bad9..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/noCheckstyleRulesToExport.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/noCheckstyleRulesToExport.xml deleted file mode 100644 index 3c5c166d0be..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/noCheckstyleRulesToExport.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/singleCheckstyleRulesToExport.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/singleCheckstyleRulesToExport.xml deleted file mode 100644 index e55f99cad0e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/singleCheckstyleRulesToExport.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/idPropertyShouldBeTheRuleKey.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/idPropertyShouldBeTheRuleKey.xml deleted file mode 100644 index d8dec5d9efb..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/idPropertyShouldBeTheRuleKey.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/importingFiltersIsNotSupported.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/importingFiltersIsNotSupported.xml deleted file mode 100644 index 55a7faa374e..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/importingFiltersIsNotSupported.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/shouldUseTheIdPropertyToFindRule.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/shouldUseTheIdPropertyToFindRule.xml deleted file mode 100644 index 97fdf2fa1be..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/shouldUseTheIdPropertyToFindRule.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/simple.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/simple.xml deleted file mode 100644 index 3cf5c96d710..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileImporterTest/simple.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/checkstyle-result.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/checkstyle-result.xml deleted file mode 100644 index e1c97ca77bd..00000000000 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/checkstyle-result.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/sonar-checkstyle-plugin/test-resources/Hello.java b/plugins/sonar-checkstyle-plugin/test-resources/Hello.java deleted file mode 100644 index 4e6f2dd42d3..00000000000 --- a/plugins/sonar-checkstyle-plugin/test-resources/Hello.java +++ /dev/null @@ -1,11 +0,0 @@ -class Hello { - - public boolean methodWithViolations() { - String foo = "foo"; - String bar = "bar"; - if (true) { - ;; - } - return foo==bar; - } -} \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/test-resources/World.java b/plugins/sonar-checkstyle-plugin/test-resources/World.java deleted file mode 100644 index 3e78a97aeaf..00000000000 --- a/plugins/sonar-checkstyle-plugin/test-resources/World.java +++ /dev/null @@ -1,8 +0,0 @@ -public class World { - - public void hello() { - if (true) { - - } - } -} \ No newline at end of file diff --git a/plugins/sonar-checkstyle-plugin/test-resources/checkstyle-conf.xml b/plugins/sonar-checkstyle-plugin/test-resources/checkstyle-conf.xml deleted file mode 100644 index 097456f6ebf..00000000000 --- a/plugins/sonar-checkstyle-plugin/test-resources/checkstyle-conf.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml index 791584db604..6ba7634f8d9 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,6 @@ plugins/sonar-core-gwt plugins/sonar-core-plugin plugins/sonar-dbcleaner-plugin - plugins/sonar-checkstyle-plugin plugins/sonar-cobertura-plugin plugins/sonar-surefire-plugin plugins/sonar-findbugs-plugin @@ -622,6 +621,11 @@ sonar-pmd-plugin ${sonarJava.version} + + org.codehaus.sonar-plugins.java + sonar-checkstyle-plugin + ${sonarJava.version} + asm asm-all diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index e28f0c264c2..2fc7443213f 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -88,9 +88,8 @@ runtime - org.codehaus.sonar.plugins + org.codehaus.sonar-plugins.java sonar-checkstyle-plugin - ${project.version} runtime diff --git a/sonar-server/pom.xml b/sonar-server/pom.xml index 24cb8024005..2714c84e605 100644 --- a/sonar-server/pom.xml +++ b/sonar-server/pom.xml @@ -412,9 +412,9 @@ provided - org.codehaus.sonar.plugins + org.codehaus.sonar-plugins.java sonar-checkstyle-plugin - ${project.version} + ${sonarJava.version} sonar-plugin provided