Skip to content

Commit 97f3c2b

Browse files
Stopbugs
1 parent da56214 commit 97f3c2b

File tree

6 files changed

+261
-120
lines changed

6 files changed

+261
-120
lines changed

build-tools/src/main/resources/bordertech/checkstyle.xml renamed to build-tools/src/main/resources/bordertech/bt-checkstyle.xml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
44
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
55

6+
<!-- Based on sun_checks.xml -->
7+
68
<!--
79
810
Checkstyle configuration that checks the sun coding conventions from:
@@ -38,13 +40,13 @@
3840
3941
<property name="basedir" value="${basedir}"/>
4042
-->
41-
43+
4244
<!-- BorderTech Filter out Checkstyle warnings that have been suppressed with the @SuppressWarnings annotation -->
4345
<module name="SuppressWarningsFilter" />
4446

45-
<!-- BorderTech
46-
<property name="fileExtensions" value="java, properties, xml"/>
47-
-->
47+
<!-- BorderTech
48+
<property name="fileExtensions" value="java, properties, xml"/>
49+
-->
4850
<property name="fileExtensions" value="java"/>
4951

5052
<!-- Checks that a package-info.java file exists for each package. -->
@@ -78,9 +80,9 @@
7880
<module name="FileTabCharacter"/>
7981
-->
8082
<module name="RegexpSingleline">
81-
<property name="format" value="^(\t*( +\t*(?! \*|\S))|( ))"/>
82-
<property name="message" value="Indentation should be tabs."/>
83-
<property name="maximum" value="10"/>
83+
<property name="format" value="^(\t*( +\t*(?! \*|\S))|( ))"/>
84+
<property name="message" value="Indentation should be tabs."/>
85+
<property name="maximum" value="10"/>
8486
</module>
8587

8688
<!-- Miscellaneous other checks. -->
@@ -101,7 +103,7 @@
101103
<module name="TreeWalker">
102104
<!-- BorderTech -->
103105
<property name="tabWidth" value="4"/>
104-
106+
105107
<!-- BorderTech Make the @SuppressWarnings annotations available to Checkstyle -->
106108
<module name="SuppressWarningsHolder" />
107109

@@ -173,7 +175,9 @@
173175
<!-- Modifier Checks -->
174176
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
175177
<module name="ModifierOrder"/>
176-
<module name="RedundantModifier"/>
178+
<module name="RedundantModifier">
179+
<property name="severity" value="warning" />
180+
</module>
177181

178182
<!-- Checks for blocks. You know, those {}'s -->
179183
<!-- See http://checkstyle.sf.net/config_blocks.html -->
@@ -224,9 +228,9 @@
224228

225229
<!-- Miscellaneous other checks. -->
226230
<!-- See http://checkstyle.sf.net/config_misc.html -->
227-
<!--
228-
<module name="ArrayTypeStyle"/>
229-
-->
231+
<!--
232+
<module name="ArrayTypeStyle"/>
233+
-->
230234
<module name="FinalParameters"/>
231235
<module name="TodoComment">
232236
<property name="severity" value="warning" />
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Default Maven PMD Plugin Ruleset" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
2+
<description>
3+
Include all categories.
4+
</description>
5+
<rule ref="category/java/bestpractices.xml"/>
6+
<rule ref="category/java/codestyle.xml">
7+
<exclude name="LongVariable"/>
8+
<exclude name="OnlyOneReturn"/>
9+
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
10+
<exclude name="LocalVariableCouldBeFinal"/>
11+
</rule>
12+
<rule ref="category/java/design.xml">
13+
<exclude name="LawOfDemeter"/>
14+
</rule>
15+
<rule ref="category/java/documentation.xml">
16+
<exclude name="CommentSize"/>
17+
</rule>
18+
<rule ref="category/java/errorprone.xml" >
19+
<exclude name="MissingSerialVersionUID"/>
20+
</rule>
21+
<rule ref="category/java/multithreading.xml"/>
22+
<rule ref="category/java/performance.xml"/>
23+
<rule ref="category/java/security.xml"/>
24+
25+
<!-- Downgrade rules from Failure to Warning. -->
26+
<rule ref="category/java/codestyle.xml/ClassNamingConventions" >
27+
<priority>3</priority>
28+
</rule>
29+
<rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod">
30+
<priority>3</priority>
31+
</rule>
32+
<rule ref="category/java/errorprone.xml/ReturnEmptyArrayRatherThanNull">
33+
<priority>3</priority>
34+
</rule>
35+
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance">
36+
<priority>3</priority>
37+
</rule>
38+
<rule ref="category/java/errorprone.xml/SuspiciousEqualsMethodName">
39+
<priority>3</priority>
40+
</rule>
41+
<rule ref="category/java/bestpractices.xml/GuardLogStatement" >
42+
<priority>3</priority>
43+
</rule>
44+
<rule ref="category/java/bestpractices.xml/SystemPrintln">
45+
<priority>3</priority>
46+
</rule>
47+
<rule ref="category/java/performance.xml/AvoidFileStream" >
48+
<priority>3</priority>
49+
</rule>
50+
51+
<!-- Property override not working
52+
<rule ref="category/java/documentation.xml/CommentRequired">
53+
<properties>
54+
<property name="fieldCommentRequirement">Ignored</property>
55+
</properties>
56+
</rule>
57+
-->
58+
59+
</ruleset>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<FindBugsFilter>
3+
4+
<!-- Auxilary Plugin Bugs -->
5+
<Match>
6+
<Bug pattern="CLI_CONSTANT_LIST_INDEX, FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY,LII_LIST_INDEXED_ITERATING, LSYC_LOCAL_SYNCHRONIZED_COLLECTION, LUI_USE_SINGLETON_LIST, PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS,PDP_POORLY_DEFINED_PARAMETER,MUI_CONTAINSKEY_BEFORE_GET,PMB_POSSIBLE_MEMORY_BLOAT,SPP_EQUALS_ON_ENUM,SUI_CONTAINS_BEFORE_ADD" />
7+
</Match>
8+
9+
<!-- Seems to give false positives. -->
10+
<Match>
11+
<Bug pattern="BED_BOGUS_EXCEPTION_DECLARATION" />
12+
</Match>
13+
14+
</FindBugsFilter>

build-tools/src/main/resources/bordertech/findbugs-exclude-filter.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

pom.xml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<properties>
1414
<surefireArgLine />
15-
<surefire.version>2.22.0</surefire.version>
15+
<surefire.version>2.22.1</surefire.version>
1616
<maven.compiler.target>1.8</maven.compiler.target>
1717
<maven.compiler.source>1.8</maven.compiler.source>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -96,16 +96,25 @@
9696

9797
<dependencyManagement>
9898
<dependencies>
99+
<!-- Common lang3 -->
99100
<dependency>
100101
<groupId>org.apache.commons</groupId>
101102
<artifactId>commons-lang3</artifactId>
102-
<version>3.8</version>
103-
<type>jar</type>
103+
<version>3.8.1</version>
104104
</dependency>
105+
<!-- Junit 5 -->
105106
<dependency>
106-
<groupId>junit</groupId>
107-
<artifactId>junit</artifactId>
108-
<version>4.12</version>
107+
<groupId>org.junit.jupiter</groupId>
108+
<artifactId>junit-jupiter-engine</artifactId>
109+
<version>5.3.2</version>
110+
<scope>test</scope>
111+
</dependency>
112+
<!-- Junit 5 support for Junit 3 and 4 -->
113+
<dependency>
114+
<groupId>org.junit.vintage</groupId>
115+
<artifactId>junit-vintage-engine</artifactId>
116+
<scope>test</scope>
117+
<version>5.3.2</version>
109118
</dependency>
110119
</dependencies>
111120
</dependencyManagement>
@@ -230,13 +239,6 @@
230239
<groupId>org.apache.maven.plugins</groupId>
231240
<artifactId>maven-surefire-plugin</artifactId>
232241
<version>${surefire.version}</version>
233-
<dependencies>
234-
<dependency>
235-
<groupId>org.apache.maven.surefire</groupId>
236-
<artifactId>surefire-junit47</artifactId>
237-
<version>${surefire.version}</version>
238-
</dependency>
239-
</dependencies>
240242
</plugin>
241243

242244
</plugins>

0 commit comments

Comments
 (0)