Browse Source

PMD fixes and rule updates

Lots more rules treated as errors now

Change-Id: Ie8065d958bd4fbd7cccb1c06aefbc459cfde01c3
Reviewed-on: http://gerrit.dmdirc.com/1746
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.5rc1
Chris Smith 13 years ago
parent
commit
47af8cd7ce

+ 82
- 84
checkstyle/pmd_checks.xml View File

@@ -7,38 +7,38 @@
7 7
         <description>DMDirc minimal PMD checks.</description>
8 8
 
9 9
 <rule ref="rulesets/basic.xml/EmptyCatchBlock"><priority>3</priority></rule>
10
-<rule ref="rulesets/basic.xml/EmptyIfStmt"><priority>2</priority></rule>
11
-<rule ref="rulesets/basic.xml/EmptyWhileStmt"><priority>2</priority></rule>
12
-<rule ref="rulesets/basic.xml/EmptyTryBlock"><priority>2</priority></rule>
13
-<rule ref="rulesets/basic.xml/EmptyFinallyBlock"><priority>2</priority></rule>
14
-<rule ref="rulesets/basic.xml/EmptySwitchStatements"><priority>2</priority></rule>
15
-<rule ref="rulesets/basic.xml/JumbledIncrementer"><priority>2</priority></rule>
16
-<rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"><priority>3</priority></rule>
17
-<rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"><priority>2</priority></rule>
18
-<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"><priority>2</priority></rule>
19
-<rule ref="rulesets/basic.xml/DoubleCheckedLocking"><priority>2</priority></rule>
20
-<rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"><priority>2</priority></rule>
21
-<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"><priority>2</priority></rule>
10
+<rule ref="rulesets/basic.xml/EmptyIfStmt"><priority>1</priority></rule>
11
+<rule ref="rulesets/basic.xml/EmptyWhileStmt"><priority>1</priority></rule>
12
+<rule ref="rulesets/basic.xml/EmptyTryBlock"><priority>1</priority></rule>
13
+<rule ref="rulesets/basic.xml/EmptyFinallyBlock"><priority>1</priority></rule>
14
+<rule ref="rulesets/basic.xml/EmptySwitchStatements"><priority>1</priority></rule>
15
+<rule ref="rulesets/basic.xml/JumbledIncrementer"><priority>1</priority></rule>
16
+<rule ref="rulesets/basic.xml/ForLoopShouldBeWhileLoop"><priority>1</priority></rule>
17
+<rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"><priority>1</priority></rule>
18
+<rule ref="rulesets/basic.xml/OverrideBothEqualsAndHashcode"><priority>1</priority></rule>
19
+<rule ref="rulesets/basic.xml/DoubleCheckedLocking"><priority>1</priority></rule>
20
+<rule ref="rulesets/basic.xml/ReturnFromFinallyBlock"><priority>1</priority></rule>
21
+<rule ref="rulesets/basic.xml/EmptySynchronizedBlock"><priority>1</priority></rule>
22 22
 <rule ref="rulesets/basic.xml/UnnecessaryReturn"><priority>2</priority></rule>
23
-<rule ref="rulesets/basic.xml/EmptyStaticInitializer"><priority>2</priority></rule>
23
+<rule ref="rulesets/basic.xml/EmptyStaticInitializer"><priority>1</priority></rule>
24 24
 <rule ref="rulesets/basic.xml/UnconditionalIfStatement"><priority>1</priority></rule>
25
-<rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"><priority>2</priority></rule>
25
+<rule ref="rulesets/basic.xml/EmptyStatementNotInLoop"><priority>1</priority></rule>
26 26
 <rule ref="rulesets/basic.xml/BooleanInstantiation"><priority>1</priority></rule>
27
-<rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"><priority>2</priority></rule>
28
-<rule ref="rulesets/basic.xml/CollapsibleIfStatements"><priority>2</priority></rule>
27
+<rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"><priority>1</priority></rule>
28
+<rule ref="rulesets/basic.xml/CollapsibleIfStatements"><priority>1</priority></rule>
29 29
 <rule ref="rulesets/basic.xml/UselessOverridingMethod"><priority>1</priority></rule>
30 30
 <rule ref="rulesets/basic.xml/ClassCastExceptionWithToArray"><priority>1</priority></rule>
31
-<rule ref="rulesets/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor"><priority>2</priority></rule>
31
+<rule ref="rulesets/basic.xml/AvoidDecimalLiteralsInBigDecimalConstructor"><priority>1</priority></rule>
32 32
 <rule ref="rulesets/basic.xml/UselessOperationOnImmutable"><priority>1</priority></rule>
33 33
 <rule ref="rulesets/basic.xml/MisplacedNullCheck"><priority>1</priority></rule>
34
-<rule ref="rulesets/basic.xml/UnusedNullCheckInEquals"><priority>2</priority></rule>
34
+<rule ref="rulesets/basic.xml/UnusedNullCheckInEquals"><priority>1</priority></rule>
35 35
 <rule ref="rulesets/basic.xml/AvoidThreadGroup"><priority>2</priority></rule>
36 36
 <rule ref="rulesets/basic.xml/BrokenNullCheck"><priority>1</priority></rule>
37
-<rule ref="rulesets/basic.xml/BigIntegerInstantiation"><priority>2</priority></rule>
37
+<rule ref="rulesets/basic.xml/BigIntegerInstantiation"><priority>1</priority></rule>
38 38
 <rule ref="rulesets/basic.xml/AvoidUsingOctalValues"><priority>2</priority></rule>
39 39
 <rule ref="rulesets/basic.xml/AvoidUsingHardCodedIP"><priority>4</priority></rule>
40
-<rule ref="rulesets/basic.xml/AvoidMultipleUnaryOperators"><priority>2</priority></rule>
41
-<rule ref="rulesets/basic.xml/EmptyInitializer"><priority>2</priority></rule>
40
+<rule ref="rulesets/basic.xml/AvoidMultipleUnaryOperators"><priority>1</priority></rule>
41
+<rule ref="rulesets/basic.xml/EmptyInitializer"><priority>1</priority></rule>
42 42
 
43 43
 <rule ref="rulesets/braces.xml/IfStmtsMustUseBraces"><priority>1</priority></rule>
44 44
 <rule ref="rulesets/braces.xml/WhileLoopsMustUseBraces"><priority>1</priority></rule>
@@ -63,19 +63,17 @@
63 63
 
64 64
 <rule ref="rulesets/controversial.xml/UnnecessaryConstructor"><priority>2</priority></rule>
65 65
 <rule ref="rulesets/controversial.xml/NullAssignment"><priority>3</priority></rule>
66
-<rule ref="rulesets/controversial.xml/UnusedModifier"><priority>3</priority></rule>
66
+<rule ref="rulesets/controversial.xml/UnusedModifier"><priority>1</priority></rule>
67 67
 <rule ref="rulesets/controversial.xml/AssignmentInOperand"><priority>2</priority></rule>
68
-<rule ref="rulesets/controversial.xml/AtLeastOneConstructor"><priority>3</priority></rule>
69 68
 <rule ref="rulesets/controversial.xml/DontImportSun"><priority>1</priority></rule>
70 69
 <rule ref="rulesets/controversial.xml/SuspiciousOctalEscape"><priority>3</priority></rule>
71 70
 <rule ref="rulesets/controversial.xml/CallSuperInConstructor"><priority>2</priority></rule>
72
-<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"><priority>2</priority></rule>
71
+<rule ref="rulesets/controversial.xml/UnnecessaryParentheses"><priority>1</priority></rule>
73 72
 <rule ref="rulesets/controversial.xml/DefaultPackage"><priority>2</priority></rule>
74 73
 <rule ref="rulesets/controversial.xml/BooleanInversion"><priority>3</priority></rule>
75
-<!-- <rule ref="rulesets/controversial.xml/DataflowAnomalyAnalysis"><priority>3</priority></rule> -->
76 74
 <rule ref="rulesets/controversial.xml/AvoidUsingShortType"><priority>3</priority></rule>
77 75
 <rule ref="rulesets/controversial.xml/AvoidUsingVolatile"><priority>3</priority></rule>
78
-<rule ref="rulesets/controversial.xml/AvoidAccessibilityAlteration"><priority>3</priority></rule>
76
+<rule ref="rulesets/controversial.xml/AvoidAccessibilityAlteration"><priority>2</priority></rule>
79 77
 <rule ref="rulesets/controversial.xml/DoNotCallGarbageCollectionExplicitly"><priority>3</priority></rule>
80 78
 
81 79
 <rule ref="rulesets/coupling.xml/CouplingBetweenObjects"><priority>3</priority></rule>
@@ -86,42 +84,42 @@
86 84
 <rule ref="rulesets/design.xml/SimplifyBooleanReturns"><priority>1</priority></rule>
87 85
 <rule ref="rulesets/design.xml/SimplifyBooleanExpressions"><priority>1</priority></rule>
88 86
 <rule ref="rulesets/design.xml/AvoidDeeplyNestedIfStmts"><priority>4</priority></rule>
89
-<rule ref="rulesets/design.xml/AvoidReassigningParameters"><priority>2</priority></rule>
87
+<rule ref="rulesets/design.xml/AvoidReassigningParameters"><priority>1</priority></rule>
90 88
 <rule ref="rulesets/design.xml/SwitchDensity"><priority>3</priority></rule>
91 89
 <rule ref="rulesets/design.xml/ConstructorCallsOverridableMethod"><priority>4</priority></rule>
92 90
 <rule ref="rulesets/design.xml/AccessorClassGeneration"><priority>3</priority></rule>
93
-<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"><priority>2</priority></rule>
94
-<rule ref="rulesets/design.xml/CloseResource"><priority>2</priority></rule>
95
-<rule ref="rulesets/design.xml/NonStaticInitializer"><priority>3</priority></rule>
91
+<rule ref="rulesets/design.xml/FinalFieldCouldBeStatic"><priority>1</priority></rule>
92
+<rule ref="rulesets/design.xml/CloseResource"><priority>1</priority></rule>
93
+<rule ref="rulesets/design.xml/NonStaticInitializer"><priority>1</priority></rule>
96 94
 <rule ref="rulesets/design.xml/DefaultLabelNotLastInSwitchStmt"><priority>4</priority></rule>
97 95
 <rule ref="rulesets/design.xml/NonCaseLabelInSwitchStatement"><priority>4</priority></rule>
98 96
 <rule ref="rulesets/design.xml/OptimizableToArrayCall"><priority>3</priority></rule>
99
-<rule ref="rulesets/design.xml/BadComparison"><priority>2</priority></rule>
97
+<rule ref="rulesets/design.xml/BadComparison"><priority>1</priority></rule>
100 98
 <rule ref="rulesets/design.xml/EqualsNull"><priority>1</priority></rule>
101 99
 <rule ref="rulesets/design.xml/ConfusingTernary"><priority>2</priority></rule>
102
-<rule ref="rulesets/design.xml/InstantiationToGetClass"><priority>2</priority></rule>
100
+<rule ref="rulesets/design.xml/InstantiationToGetClass"><priority>1</priority></rule>
103 101
 <rule ref="rulesets/design.xml/IdempotentOperations"><priority>1</priority></rule>
104 102
 <rule ref="rulesets/design.xml/SimpleDateFormatNeedsLocale"><priority>5</priority></rule>
105 103
 <rule ref="rulesets/design.xml/ImmutableField"><priority>2</priority></rule>
106 104
 <rule ref="rulesets/design.xml/UseLocaleWithCaseConversions"><priority>5</priority></rule>
107 105
 <rule ref="rulesets/design.xml/AvoidProtectedFieldInFinalClass"><priority>2</priority></rule>
108
-<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"><priority>3</priority></rule>
109
-<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"><priority>2</priority></rule>
106
+<rule ref="rulesets/design.xml/AssignmentToNonFinalStatic"><priority>1</priority></rule>
107
+<rule ref="rulesets/design.xml/MissingStaticMethodInNonInstantiatableClass"><priority>1</priority></rule>
110 108
 <rule ref="rulesets/design.xml/AvoidSynchronizedAtMethodLevel"><priority>4</priority></rule>
111 109
 <rule ref="rulesets/design.xml/MissingBreakInSwitch"><priority>4</priority></rule>
112
-<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"><priority>3</priority></rule>
113
-<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"><priority>2</priority></rule>
110
+<rule ref="rulesets/design.xml/UseNotifyAllInsteadOfNotify"><priority>1</priority></rule>
111
+<rule ref="rulesets/design.xml/AvoidInstanceofChecksInCatchClause"><priority>1</priority></rule>
114 112
 <rule ref="rulesets/design.xml/AbstractClassWithoutAbstractMethod"><priority>5</priority></rule>
115
-<rule ref="rulesets/design.xml/SimplifyConditional"><priority>2</priority></rule>
113
+<rule ref="rulesets/design.xml/SimplifyConditional"><priority>1</priority></rule>
116 114
 <rule ref="rulesets/design.xml/CompareObjectsWithEquals"><priority>3</priority></rule>
117 115
 <rule ref="rulesets/design.xml/PositionLiteralsFirstInComparisons"><priority>3</priority></rule>
118
-<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"><priority>2</priority></rule>
116
+<rule ref="rulesets/design.xml/UnnecessaryLocalBeforeReturn"><priority>1</priority></rule>
119 117
 <rule ref="rulesets/design.xml/NonThreadSafeSingleton"><priority>1</priority></rule>
120 118
 <rule ref="rulesets/design.xml/UncommentedEmptyMethod"><priority>2</priority></rule>
121 119
 <rule ref="rulesets/design.xml/UncommentedEmptyConstructor"><priority>1</priority></rule>
122
-<rule ref="rulesets/design.xml/AvoidConstantsInterface"><priority>2</priority></rule>
123
-<rule ref="rulesets/design.xml/UnsynchronizedStaticDateFormatter"><priority>3</priority></rule>
124
-<rule ref="rulesets/design.xml/PreserveStackTrace"><priority>3</priority></rule>
120
+<rule ref="rulesets/design.xml/AvoidConstantsInterface"><priority>1</priority></rule>
121
+<rule ref="rulesets/design.xml/UnsynchronizedStaticDateFormatter"><priority>1</priority></rule>
122
+<rule ref="rulesets/design.xml/PreserveStackTrace"><priority>1</priority></rule>
125 123
 <rule ref="rulesets/design.xml/UseCollectionIsEmpty"><priority>2</priority></rule>
126 124
 <rule ref="rulesets/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"><priority>2</priority></rule>
127 125
 <rule ref="rulesets/design.xml/EmptyMethodInAbstractClassShouldBeAbstract"><priority>2</priority></rule>
@@ -129,89 +127,89 @@
129 127
 <rule ref="rulesets/design.xml/ReturnEmptyArrayRatherThanNull"><priority>2</priority></rule>
130 128
 <rule ref="rulesets/design.xml/AbstractClassWithoutAnyMethod"><priority>2</priority></rule>
131 129
 
132
-<rule ref="rulesets/finalizers.xml/EmptyFinalizer"><priority>2</priority></rule>
133
-<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"><priority>2</priority></rule>
134
-<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"><priority>2</priority></rule>
135
-<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"><priority>2</priority></rule>
136
-<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"><priority>2</priority></rule>
137
-<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"><priority>2</priority></rule>
130
+<rule ref="rulesets/finalizers.xml/EmptyFinalizer"><priority>1</priority></rule>
131
+<rule ref="rulesets/finalizers.xml/FinalizeOnlyCallsSuperFinalize"><priority>1</priority></rule>
132
+<rule ref="rulesets/finalizers.xml/FinalizeOverloaded"><priority>1</priority></rule>
133
+<rule ref="rulesets/finalizers.xml/FinalizeDoesNotCallSuperFinalize"><priority>1</priority></rule>
134
+<rule ref="rulesets/finalizers.xml/FinalizeShouldBeProtected"><priority>1</priority></rule>
135
+<rule ref="rulesets/finalizers.xml/AvoidCallingFinalize"><priority>1</priority></rule>
138 136
 
139 137
 <rule ref="rulesets/imports.xml/DuplicateImports"><priority>1</priority></rule>
140 138
 <rule ref="rulesets/imports.xml/DontImportJavaLang"><priority>1</priority></rule>
141
-<rule ref="rulesets/imports.xml/UnusedImports"><priority>2</priority></rule>
142
-<rule ref="rulesets/imports.xml/ImportFromSamePackage"><priority>2</priority></rule>
139
+<rule ref="rulesets/imports.xml/UnusedImports"><priority>1</priority></rule>
140
+<rule ref="rulesets/imports.xml/ImportFromSamePackage"><priority>1</priority></rule>
143 141
 <rule ref="rulesets/imports.xml/TooManyStaticImports"><priority>4</priority></rule>
144 142
 
145 143
 <rule ref="rulesets/javabeans.xml/BeanMembersShouldSerialize"><priority>5</priority></rule>
146 144
 <rule ref="rulesets/javabeans.xml/MissingSerialVersionUID"><priority>5</priority></rule>
147 145
 
148
-<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"><priority>2</priority></rule>
149
-<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"><priority>2</priority></rule>
146
+<rule ref="rulesets/logging-java.xml/MoreThanOneLogger"><priority>1</priority></rule>
147
+<rule ref="rulesets/logging-java.xml/LoggerIsNotStaticFinal"><priority>1</priority></rule>
150 148
 <rule ref="rulesets/logging-java.xml/SystemPrintln"><priority>2</priority></rule>
151 149
 <rule ref="rulesets/logging-java.xml/AvoidPrintStackTrace"><priority>2</priority></rule>
152 150
 
153 151
 <rule ref="rulesets/migrating.xml/ReplaceVectorWithList"><priority>3</priority></rule>
154
-<rule ref="rulesets/migrating.xml/ReplaceHashtableWithMap"><priority>3</priority></rule>
155
-<rule ref="rulesets/migrating.xml/ReplaceEnumerationWithIterator"><priority>3</priority></rule>
152
+<rule ref="rulesets/migrating.xml/ReplaceHashtableWithMap"><priority>1</priority></rule>
153
+<rule ref="rulesets/migrating.xml/ReplaceEnumerationWithIterator"><priority>1</priority></rule>
156 154
 <rule ref="rulesets/migrating.xml/AvoidEnumAsIdentifier"><priority>1</priority></rule>
157 155
 <rule ref="rulesets/migrating.xml/AvoidAssertAsIdentifier"><priority>1</priority></rule>
158
-<rule ref="rulesets/migrating.xml/IntegerInstantiation"><priority>3</priority></rule>
159
-<rule ref="rulesets/migrating.xml/ByteInstantiation"><priority>3</priority></rule>
160
-<rule ref="rulesets/migrating.xml/ShortInstantiation"><priority>3</priority></rule>
161
-<rule ref="rulesets/migrating.xml/LongInstantiation"><priority>3</priority></rule>
156
+<rule ref="rulesets/migrating.xml/IntegerInstantiation"><priority>1</priority></rule>
157
+<rule ref="rulesets/migrating.xml/ByteInstantiation"><priority>1</priority></rule>
158
+<rule ref="rulesets/migrating.xml/ShortInstantiation"><priority>1</priority></rule>
159
+<rule ref="rulesets/migrating.xml/LongInstantiation"><priority>1</priority></rule>
162 160
 
163 161
 <rule ref="rulesets/naming.xml/ShortVariable"><priority>3</priority></rule>
164 162
 <rule ref="rulesets/naming.xml/LongVariable"><priority>2</priority></rule>
165 163
 <rule ref="rulesets/naming.xml/ShortMethodName"><priority>2</priority></rule>
166
-<rule ref="rulesets/naming.xml/VariableNamingConventions"><priority>2</priority></rule>
167
-<rule ref="rulesets/naming.xml/MethodNamingConventions"><priority>2</priority></rule>
168
-<rule ref="rulesets/naming.xml/ClassNamingConventions"><priority>2</priority></rule>
164
+<rule ref="rulesets/naming.xml/VariableNamingConventions"><priority>1</priority></rule>
165
+<rule ref="rulesets/naming.xml/MethodNamingConventions"><priority>1</priority></rule>
166
+<rule ref="rulesets/naming.xml/ClassNamingConventions"><priority>1</priority></rule>
169 167
 <rule ref="rulesets/naming.xml/AvoidDollarSigns"><priority>1</priority></rule>
170
-<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"><priority>2</priority></rule>
168
+<rule ref="rulesets/naming.xml/MethodWithSameNameAsEnclosingClass"><priority>1</priority></rule>
171 169
 <rule ref="rulesets/naming.xml/SuspiciousHashcodeMethodName"><priority>1</priority></rule>
172
-<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"><priority>2</priority></rule>
173
-<rule ref="rulesets/naming.xml/SuspiciousEqualsMethodName"><priority>2</priority></rule>
170
+<rule ref="rulesets/naming.xml/SuspiciousConstantFieldName"><priority>1</priority></rule>
171
+<rule ref="rulesets/naming.xml/SuspiciousEqualsMethodName"><priority>1</priority></rule>
174 172
 <rule ref="rulesets/naming.xml/AvoidFieldNameMatchingTypeName"><priority>2</priority></rule>
175 173
 <rule ref="rulesets/naming.xml/AvoidFieldNameMatchingMethodName"><priority>2</priority></rule>
176 174
 <rule ref="rulesets/naming.xml/NoPackage"><priority>1</priority></rule>
177
-<rule ref="rulesets/naming.xml/PackageCase"><priority>2</priority></rule>
175
+<rule ref="rulesets/naming.xml/PackageCase"><priority>1</priority></rule>
178 176
 <rule ref="rulesets/naming.xml/BooleanGetMethodName"><priority>2</priority></rule>
179 177
 
180 178
 <rule ref="rulesets/optimizations.xml/LocalVariableCouldBeFinal"><priority>2</priority></rule>
181 179
 <rule ref="rulesets/optimizations.xml/MethodArgumentCouldBeFinal"><priority>1</priority></rule>
182 180
 <rule ref="rulesets/optimizations.xml/AvoidInstantiatingObjectsInLoops"><priority>3</priority></rule>
183
-<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"><priority>2</priority></rule>
184
-<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"><priority>2</priority></rule>
181
+<rule ref="rulesets/optimizations.xml/UseArrayListInsteadOfVector"><priority>1</priority></rule>
182
+<rule ref="rulesets/optimizations.xml/SimplifyStartsWith"><priority>1</priority></rule>
185 183
 <rule ref="rulesets/optimizations.xml/UseStringBufferForStringAppends"><priority>3</priority></rule>
186 184
 <rule ref="rulesets/optimizations.xml/UseArraysAsList"><priority>1</priority></rule>
187 185
 <rule ref="rulesets/optimizations.xml/AvoidArrayLoops"><priority>1</priority></rule>
188
-<rule ref="rulesets/optimizations.xml/UnnecessaryWrapperObjectCreation"><priority>2</priority></rule>
186
+<rule ref="rulesets/optimizations.xml/UnnecessaryWrapperObjectCreation"><priority>1</priority></rule>
189 187
 <rule ref="rulesets/optimizations.xml/AddEmptyString"><priority>2</priority></rule>
190 188
 
191 189
 <rule ref="rulesets/strictexception.xml/AvoidCatchingThrowable"><priority>1</priority></rule>
192
-<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"><priority>2</priority></rule>
193
-<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"><priority>2</priority></rule>
190
+<rule ref="rulesets/strictexception.xml/SignatureDeclareThrowsException"><priority>1</priority></rule>
191
+<rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl"><priority>1</priority></rule>
194 192
 <rule ref="rulesets/strictexception.xml/AvoidCatchingNPE"><priority>1</priority></rule>
195
-<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"><priority>2</priority></rule>
193
+<rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes"><priority>1</priority></rule>
196 194
 <rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException"><priority>3</priority></rule>
197 195
 <rule ref="rulesets/strictexception.xml/AvoidRethrowingException"><priority>2</priority></rule>
198
-<rule ref="rulesets/strictexception.xml/DoNotExtendJavaLangError"><priority>2</priority></rule>
196
+<rule ref="rulesets/strictexception.xml/DoNotExtendJavaLangError"><priority>1</priority></rule>
199 197
 <rule ref="rulesets/strictexception.xml/DoNotThrowExceptionInFinally"><priority>1</priority></rule>
200 198
 <rule ref="rulesets/strictexception.xml/AvoidThrowingNewInstanceOfSameException"><priority>1</priority></rule>
201 199
 
202 200
 <rule ref="rulesets/strings.xml/AvoidDuplicateLiterals"><priority>3</priority></rule>
203
-<rule ref="rulesets/strings.xml/StringInstantiation"><priority>2</priority></rule>
204
-<rule ref="rulesets/strings.xml/StringToString"><priority>2</priority></rule>
205
-<rule ref="rulesets/strings.xml/InefficientStringBuffering"><priority>2</priority></rule>
206
-<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"><priority>2</priority></rule>
207
-<rule ref="rulesets/strings.xml/UseStringBufferLength"><priority>2</priority></rule>
208
-<rule ref="rulesets/strings.xml/AppendCharacterWithChar"><priority>2</priority></rule>
209
-<rule ref="rulesets/strings.xml/UseIndexOfChar"><priority>2</priority></rule>
210
-<rule ref="rulesets/strings.xml/InefficientEmptyStringCheck"><priority>2</priority></rule>
201
+<rule ref="rulesets/strings.xml/StringInstantiation"><priority>1</priority></rule>
202
+<rule ref="rulesets/strings.xml/StringToString"><priority>1</priority></rule>
203
+<rule ref="rulesets/strings.xml/InefficientStringBuffering"><priority>1</priority></rule>
204
+<rule ref="rulesets/strings.xml/UnnecessaryCaseChange"><priority>1</priority></rule>
205
+<rule ref="rulesets/strings.xml/UseStringBufferLength"><priority>1</priority></rule>
206
+<rule ref="rulesets/strings.xml/AppendCharacterWithChar"><priority>1</priority></rule>
207
+<rule ref="rulesets/strings.xml/UseIndexOfChar"><priority>1</priority></rule>
208
+<rule ref="rulesets/strings.xml/InefficientEmptyStringCheck"><priority>1</priority></rule>
211 209
 <rule ref="rulesets/strings.xml/InsufficientStringBufferDeclaration"><priority>3</priority></rule>
212
-<rule ref="rulesets/strings.xml/UselessStringValueOf"><priority>2</priority></rule>
213
-<rule ref="rulesets/strings.xml/StringBufferInstantiationWithChar"><priority>2</priority></rule>
214
-<rule ref="rulesets/strings.xml/UseEqualsToCompareStrings"><priority>2</priority></rule>
210
+<rule ref="rulesets/strings.xml/UselessStringValueOf"><priority>1</priority></rule>
211
+<rule ref="rulesets/strings.xml/StringBufferInstantiationWithChar"><priority>1</priority></rule>
212
+<rule ref="rulesets/strings.xml/UseEqualsToCompareStrings"><priority>1</priority></rule>
215 213
 <rule ref="rulesets/strings.xml/AvoidStringBufferField"><priority>2</priority></rule>
216 214
 
217 215
 <rule ref="rulesets/sunsecure.xml/MethodReturnsInternalArray"><priority>3</priority></rule>
@@ -223,8 +221,8 @@
223 221
 <rule ref="rulesets/typeresolution.xml/SignatureDeclareThrowsException"><priority>1</priority></rule>
224 222
 
225 223
 <rule ref="rulesets/unusedcode.xml/UnusedPrivateField"><priority>2</priority></rule>
226
-<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"><priority>2</priority></rule>
227
-<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"><priority>2</priority></rule>
224
+<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"><priority>1</priority></rule>
225
+<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"><priority>1</priority></rule>
228 226
 <rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"><priority>2</priority></rule>
229 227
 
230 228
 </ruleset>

+ 1
- 1
src/com/dmdirc/CertificateManager.java View File

@@ -349,7 +349,7 @@ public class CertificateManager implements X509TrustManager {
349 349
             try {
350 350
                 actionSem.acquire();
351 351
             } catch (InterruptedException ie) {
352
-                throw new CertificateException("Thread aborted, ");
352
+                throw new CertificateException("Thread aborted", ie);
353 353
             }
354 354
 
355 355
             switch (action) {

+ 1
- 3
src/com/dmdirc/Server.java View File

@@ -916,10 +916,8 @@ public class Server extends WritableFrameContainer<ServerWindow> implements Conf
916 916
                 }
917 917
 
918 918
                 parser.joinChannels(pending.toArray(new ChannelJoinRequest[pending.size()]));
919
-            } else {
920
-                // TODO: Need to pass key
921
-                // TODO (uris): address.getChannels().add(channel);
922 919
             }
920
+            // TODO: otherwise: address.getChannels().add(channel);
923 921
         }
924 922
     }
925 923
 

+ 1
- 1
src/com/dmdirc/WritableFrameContainer.java View File

@@ -329,7 +329,7 @@ public abstract class WritableFrameContainer<T extends InputWindow> extends Fram
329 329
             containers.addAll(getServer().getChildren());
330 330
 
331 331
             for (FrameContainer<?> container : containers) {
332
-                if (container == null || !(container instanceof WritableFrameContainer<?>)) {
332
+                if (!(container instanceof WritableFrameContainer<?>)) {
333 333
                     continue;
334 334
                 }
335 335
 

+ 1
- 1
src/com/dmdirc/commandparser/commands/global/Active.java View File

@@ -56,7 +56,7 @@ public final class Active extends Command implements IntelligentCommand,
56 56
         
57 57
         final FrameContainer<?> window = WindowManager.getActiveWindow();
58 58
         
59
-        if (window != null && window instanceof WritableFrameContainer<?>) {
59
+        if (window instanceof WritableFrameContainer<?>) {
60 60
             ((WritableFrameContainer<?>) window).getCommandParser()
61 61
                     .parseCommand(window, context.getSource(), command);
62 62
         }

+ 1
- 3
src/com/dmdirc/commandparser/commands/server/Ignore.java View File

@@ -44,7 +44,7 @@ import java.util.regex.PatternSyntaxException;
44 44
  * @author chris
45 45
  */
46 46
 public final class Ignore extends Command implements IntelligentCommand,
47
-        CommandInfo{
47
+        CommandInfo {
48 48
     
49 49
     /**
50 50
      * Creates a new instance of Ignore.
@@ -196,8 +196,6 @@ public final class Ignore extends Command implements IntelligentCommand,
196 196
         } else if (arg == 1 && context.getPreviousArgs().get(0).equals("--regex")) {
197 197
             targets.include(TabCompletionType.CHANNEL_NICK);
198 198
             targets.include(TabCompletionType.QUERY_NICK);
199
-        } else if (arg == 1 && context.getPreviousArgs().get(0).equals("--remove")) {
200
-            // TODO: If/when passed a server, include known ignore list entries
201 199
         }
202 200
         
203 201
         return targets;

+ 2
- 4
src/com/dmdirc/installer/Main.java View File

@@ -98,11 +98,9 @@ public final class Main {
98 98
     public static synchronized Installer getInstaller() {
99 99
         if (myInstaller == null) {
100 100
             final String osName = System.getProperty("os.name");
101
-            if (osName.startsWith("Mac OS")) {
102
-                // myInstaller = new MacInstaller();
103
-            } else if (osName.startsWith("Windows")) {
101
+            if (osName.startsWith("Windows")) {
104 102
                 myInstaller = new WindowsInstaller();
105
-            } else {
103
+            } else if(!osName.startsWith("Mac OS")) {
106 104
                 myInstaller = new LinuxInstaller();
107 105
             }
108 106
         }

+ 1
- 1
src/com/dmdirc/installer/StreamReader.java View File

@@ -92,7 +92,7 @@ public class StreamReader extends Thread {
92 92
             while ((line = reader.readLine()) != null) {
93 93
                 if (data != null) {
94 94
                     if (data.length() > 0) {
95
-                        data.append("\n");
95
+                        data.append('\n');
96 96
                     }
97 97
                     data.append(line);
98 98
                 }

+ 1
- 1
src/com/dmdirc/plugins/PluginInfo.java View File

@@ -614,7 +614,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
614 614
             final String[] filelist = files.split("\\|");
615 615
             boolean foundFile = false;
616 616
             for (String file : filelist) {
617
-                if ((new File(file)).exists()) {
617
+                if (new File(file).exists()) {
618 618
                     foundFile = true;
619 619
                     break;
620 620
                 }

+ 10
- 10
src/com/dmdirc/ui/core/util/Utils.java View File

@@ -1,17 +1,17 @@
1 1
 /*
2
- * 
2
+ *
3 3
  * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
4
- * 
4
+ *
5 5
  * Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
  * of this software and associated documentation files (the "Software"), to deal
7 7
  * in the Software without restriction, including without limitation the rights
8 8
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 9
  * copies of the Software, and to permit persons to whom the Software is
10 10
  * furnished to do so, subject to the following conditions:
11
- * 
11
+ *
12 12
  * The above copyright notice and this permission notice shall be included in
13 13
  * all copies or substantial portions of the Software.
14
- * 
14
+ *
15 15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 16
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 17
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -56,7 +56,7 @@ public class Utils {
56 56
      * @param lineParts Parts of a line comprising the whole
57 57
      * @param fontName Default font name to use
58 58
      * @param fontSize Default font size to use
59
-     * 
59
+     *
60 60
      * @return AttributedString representing the specified StyledDocument
61 61
      */
62 62
     public static ExtendedAttributedString getAttributedString(final Styliser styliser,
@@ -73,7 +73,7 @@ public class Utils {
73 73
                     "Unable to insert styled string: " +
74 74
                     ex.getMessage());
75 75
         }
76
-        
76
+
77 77
         if (attString.getIterator().getEndIndex() != 0) {
78 78
             final Font font = new Font(fontName, Font.PLAIN, fontSize);
79 79
             attString.addAttribute(TextAttribute.SIZE, font.getSize());
@@ -140,16 +140,16 @@ public class Utils {
140 140
                     attString.addAttribute(TextAttribute.UNDERLINE,
141 141
                             TextAttribute.UNDERLINE_ON, element.getStartOffset(),
142 142
                             element.getEndOffset());
143
-                } else if (attrib == IRCTextAttribute.SMILEY) {
144
-                    /* Lets avoid showing broken smileys shall we!
143
+                } /* else if (attrib == IRCTextAttribute.SMILEY) {
144
+                    Lets avoid showing broken smileys shall we!
145 145
                     final Image image = IconManager.getIconManager().getImage((String) as.getAttribute(attrib)).
146 146
                     getScaledInstance(14, 14, Image.SCALE_DEFAULT);
147 147
                     ImageGraphicAttribute iga = new ImageGraphicAttribute(image,
148 148
                     (int) BOTTOM_ALIGNMENT, 5, 5);
149 149
                     attString.addAttribute(TextAttribute.CHAR_REPLACEMENT, iga,
150 150
                     element.getStartOffset(), element.getEndOffset());
151
-                     */
152
-                }
151
+
152
+                }*/
153 153
             }
154 154
         }
155 155
 

+ 3
- 4
src/com/dmdirc/ui/input/TabCompleter.java View File

@@ -139,10 +139,9 @@ public class TabCompleter {
139 139
     public void addEntry(final TabCompletionType type, final String entry) {
140 140
         entries.add(type, entry);
141 141
 
142
-        if (type == TabCompletionType.COMMAND
143
-                && entry.startsWith(String.valueOf(CommandManager.getCommandChar()))
144
-                && !entry.startsWith(String.valueOf(CommandManager.getCommandChar())
145
-                + CommandManager.getSilenceChar())) {
142
+        if (type == TabCompletionType.COMMAND && entry.length() > 1
143
+                && entry.charAt(0) == CommandManager.getCommandChar()
144
+                && entry.charAt(1) != CommandManager.getSilenceChar()) {
146 145
             // If we're adding a command name that doesn't include the silence
147 146
             // character, also add a version with the silence char
148 147
             addEntry(type, entry.substring(0, 1) + CommandManager.getSilenceChar()

Loading…
Cancel
Save