diff --git a/.checkstyle b/.checkstyle index e073af446315bd12c4603da4c45176a28ff5ca6c..e8ce6f3266ee4b8b6d07b25347ed5bddc66bb3df 100644 --- a/.checkstyle +++ b/.checkstyle @@ -1,10 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> -<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false"> +<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false"> <local-check-config name="TeeTime" location="conf/quality-config/cs-conf.xml" type="project" description=""> <additional-data name="protect-config-file" value="false"/> </local-check-config> - <fileset name="all" enabled="true" check-config-name="TeeTime" local="true"> - <file-match-pattern match-pattern="." include-pattern="true"/> + <local-check-config name="maven-checkstyle-plugin default" location="file:/C:/Users/chw/Repositories/teetime/conf/quality-config/cs-conf.xml" type="remote" description="maven-checkstyle-plugin configuration default"> + <property name="checkstyle.cache.file" value="${project_loc}/target/checkstyle-cachefile"/> + <property name="checkstyle.header.file" value="C:\Users\chw\Repositories\teetime\target\checkstyle-header-default.txt"/> + </local-check-config> + <fileset name="java-sources-default" enabled="true" check-config-name="maven-checkstyle-plugin default" local="true"> + <file-match-pattern match-pattern="src/main/java/.*\.java" include-pattern="true"/> + <file-match-pattern match-pattern="src/test/java/.*\.java" include-pattern="true"/> + <file-match-pattern match-pattern="src/main/resources/.*\.properties" include-pattern="true"/> + <file-match-pattern match-pattern="src/test/resources/.*\.properties" include-pattern="true"/> </fileset> </fileset-config> diff --git a/.project b/.project index 9c7a3eb0d7770870a1a8064f5071cf4d6d79247e..c3dde7d007d57e79f312855139ed9e54b09ae679 100644 --- a/.project +++ b/.project @@ -25,11 +25,17 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature> <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature> + <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> </natures> </projectDescription> diff --git a/.settings/edu.umd.cs.findbugs.core.prefs b/.settings/edu.umd.cs.findbugs.core.prefs index 9df0c3ff22aeb08d71db3835bd78c10dd79f2dc5..875d0623d0be4e3d2be8fd97ddcd22c3edcd0b26 100644 --- a/.settings/edu.umd.cs.findbugs.core.prefs +++ b/.settings/edu.umd.cs.findbugs.core.prefs @@ -1,5 +1,5 @@ #FindBugs User Preferences -#Tue Dec 16 13:48:45 CET 2014 +#Tue Dec 16 15:34:05 CET 2014 detector_threshold=3 effort=max excludefilter0=.fbExcludeFilterFile|true diff --git a/conf/quality-config/pmd-ruleset.xml b/conf/quality-config/pmd-ruleset.xml index 7d6aadd1aec5101729358c80683b23f41372f01b..ca85b86a561fdbbdc34a63ffe652ae76099c0466 100644 --- a/conf/quality-config/pmd-ruleset.xml +++ b/conf/quality-config/pmd-ruleset.xml @@ -21,7 +21,7 @@ <rule ref="rulesets/java/empty.xml" /> <rule ref="rulesets/java/finalizers.xml" /> <rule ref="rulesets/java/imports.xml" /> - <rule ref="rulesets/java/j2ee.xml" /> +<!-- <rule ref="rulesets/java/j2ee.xml" /> --> <rule ref="rulesets/java/javabeans.xml" /> <rule ref="rulesets/java/junit.xml" /> <rule ref="rulesets/java/logging-jakarta-commons.xml" /> @@ -62,6 +62,10 @@ <rule ref="rulesets/java/controversial.xml"> <exclude name="AtLeastOneConstructor" /> </rule> + + <rule ref="rulesets/java/j2ee.xml"> + <exclude name="DoNotUseThreads" /> + </rule> <rule ref="rulesets/java/naming.xml/VariableNamingConventions"> <priority>5</priority> diff --git a/src/main/java/teetime/framework/AbstractInterThreadPipe.java b/src/main/java/teetime/framework/AbstractInterThreadPipe.java index 980210899354588747cd2339406db559a0be709b..37d49567462e2eef0c2b6225f61f52e887d572c7 100644 --- a/src/main/java/teetime/framework/AbstractInterThreadPipe.java +++ b/src/main/java/teetime/framework/AbstractInterThreadPipe.java @@ -32,7 +32,7 @@ public abstract class AbstractInterThreadPipe extends AbstractPipe { } @Override - public void reportNewElement() { // NOPMD + public void reportNewElement() { // do nothing } } diff --git a/src/main/java/teetime/framework/AnalysisConfiguration.java b/src/main/java/teetime/framework/AnalysisConfiguration.java index bb8cbb8b1bbb51a47396920211da5d92aebc0765..35a11e971ff92bca8db2d49dbe62f3335393b83d 100644 --- a/src/main/java/teetime/framework/AnalysisConfiguration.java +++ b/src/main/java/teetime/framework/AnalysisConfiguration.java @@ -12,7 +12,7 @@ public class AnalysisConfiguration { public AnalysisConfiguration() {} - List<Stage> getThreadableStageJobs() { // NOPMD only Analysis should use this method + List<Stage> getThreadableStageJobs() { return this.threadableStageJobs; } diff --git a/src/main/java/teetime/framework/RunnableStage.java b/src/main/java/teetime/framework/RunnableStage.java index 89340d200883e727de82844f2d9bc6ff800de20f..464f695eab14c116e6413f7fee7c00fb59bce054 100644 --- a/src/main/java/teetime/framework/RunnableStage.java +++ b/src/main/java/teetime/framework/RunnableStage.java @@ -11,7 +11,7 @@ import teetime.framework.validation.AnalysisNotValidException; public class RunnableStage implements Runnable { private final Stage stage; - private final Logger logger; // NOPMD + private final Logger logger; private boolean validationEnabled; public RunnableStage(final Stage stage) { diff --git a/src/main/java/teetime/framework/Stage.java b/src/main/java/teetime/framework/Stage.java index f947b21502906d732e8ac7e1dcee3a708d0d3fe6..11cccdc9e7b4b63d8f7f3c7c150bf45d29cac422 100644 --- a/src/main/java/teetime/framework/Stage.java +++ b/src/main/java/teetime/framework/Stage.java @@ -10,7 +10,7 @@ import org.slf4j.LoggerFactory; import teetime.framework.signal.ISignal; import teetime.framework.validation.InvalidPortConnection; -public abstract class Stage { // NOPMD (should not start with "Abstract") +public abstract class Stage { private static final ConcurrentMap<String, Integer> INSTANCES_COUNTER = new ConcurrentHashMap<String, Integer>(); @@ -18,7 +18,7 @@ public abstract class Stage { // NOPMD (should not start with "Abstract") /** * A unique logger instance per stage instance */ - protected final Logger logger; // NOPMD + protected final Logger logger; protected Stage() { this.id = this.createId(); @@ -47,7 +47,7 @@ public abstract class Stage { // NOPMD (should not start with "Abstract") return newId; } - static void clearInstanceCounters() { // NOPMD (package-private to clear map in tests) + static void clearInstanceCounters() { INSTANCES_COUNTER.clear(); } diff --git a/src/main/java/teetime/util/classpath/FileSearcher.java b/src/main/java/teetime/util/classpath/FileSearcher.java index 7476a9b2101a1ec36e8c28dabaa73678925dd24c..016537e1edddbbb65a3d78697ffe2f95c6eeaa39 100644 --- a/src/main/java/teetime/util/classpath/FileSearcher.java +++ b/src/main/java/teetime/util/classpath/FileSearcher.java @@ -18,8 +18,8 @@ public final class FileSearcher { final List<URL> list = new ArrayList<URL>(); final Enumeration<URL> systemRes = CLASS_LOADER.getResources(name); - while (systemRes.hasMoreElements()) { // NOPMD - list.add(systemRes.nextElement()); // NOPMD + while (systemRes.hasMoreElements()) { + list.add(systemRes.nextElement()); } return list; } diff --git a/src/main/java/teetime/util/list/CommittableResizableArrayQueue.java b/src/main/java/teetime/util/list/CommittableResizableArrayQueue.java index 2e31a320783e77547945c49329c6f6f8e5a5ac16..73a5079b283b013f46e20684f8d691c62a73f46c 100644 --- a/src/main/java/teetime/util/list/CommittableResizableArrayQueue.java +++ b/src/main/java/teetime/util/list/CommittableResizableArrayQueue.java @@ -17,7 +17,7 @@ public class CommittableResizableArrayQueue<T> implements CommittableQueue<T> { this.elements = this.arrayPool.acquire(initialCapacity + 1); this.elements[0] = (T) emptyObject; // optimization: avoids the use of an index out-of-bounds check - this.clear(); // NOPMD + this.clear(); } @Override diff --git a/src/test/java/teetime/util/classpath/FileSearcherTest.java b/src/test/java/teetime/util/classpath/FileSearcherTest.java index 44ca4ad7dac3d2bf7bcde24825b2cd3d91838f8e..9ebd0425922b995ca3e3d1663c5c0393ec606cdd 100644 --- a/src/test/java/teetime/util/classpath/FileSearcherTest.java +++ b/src/test/java/teetime/util/classpath/FileSearcherTest.java @@ -16,19 +16,19 @@ public class FileSearcherTest { @Test public void fileInClasspath() throws IOException { final List<URL> list = FileSearcher.loadResources("pipe-factories.conf"); - Assert.assertEquals(false, list.isEmpty()); // NOPMD + Assert.assertEquals(false, list.isEmpty()); } @Test public void multipleFiles() throws IOException { final List<URL> list = FileSearcher.loadResources("LICENSE.txt"); - Assert.assertEquals(true, list.size() > 1); // NOPMD + Assert.assertEquals(true, list.size() > 1); } @Test public void missingFile() throws IOException { final List<URL> list = FileSearcher.loadResources("filethatdoesnotexistinanyproject.nope"); - Assert.assertEquals(true, list.isEmpty()); // NOPMD + Assert.assertEquals(true, list.isEmpty()); } }