@@ -9,8 +9,8 @@ The Basic ruleset contains a collection of good practices which should be follow
9
9
</description >
10
10
11
11
<rule name =" JumbledIncrementer"
12
- language =" java"
13
- since =" 1.0"
12
+ language =" java"
13
+ since =" 1.0"
14
14
message =" Avoid modifying an outer loop incrementer in an inner loop for update expression"
15
15
class =" net.sourceforge.pmd.lang.rule.XPathRule"
16
16
externalInfoUrl =" ${pmd.website.baseurl}/rules/java/basic.html#JumbledIncrementer" >
@@ -144,9 +144,9 @@ public class Foo {
144
144
synchronized(this) {
145
145
if (baz == null) {
146
146
baz = new Object();
147
- }
148
- }
149
- }
147
+ }
148
+ }
149
+ }
150
150
return baz;
151
151
}
152
152
}
@@ -386,7 +386,7 @@ BigDecimal bd = new BigDecimal(12); // preferred approach, ok for integer v
386
386
387
387
388
388
<rule name =" MisplacedNullCheck"
389
- language =" java"
389
+ language =" java"
390
390
since =" 3.5"
391
391
message =" The null check here is misplaced; if the variable is null there will be a NullPointerException"
392
392
class =" net.sourceforge.pmd.lang.rule.XPathRule"
@@ -441,7 +441,7 @@ public class Foo {
441
441
442
442
443
443
<rule name =" AvoidThreadGroup"
444
- language =" java"
444
+ language =" java"
445
445
since =" 3.6"
446
446
message =" Avoid using java.lang.ThreadGroup; it is not thread safe"
447
447
class =" net.sourceforge.pmd.lang.rule.XPathRule"
@@ -527,10 +527,10 @@ bi4 = new BigInteger(0); // reference BigInteger.ZERO instead
527
527
class =" net.sourceforge.pmd.lang.java.rule.basic.AvoidUsingOctalValuesRule"
528
528
externalInfoUrl =" ${pmd.website.baseurl}/rules/java/basic.html#AvoidUsingOctalValues" >
529
529
<description >
530
- <![CDATA[
530
+ <![CDATA[
531
531
Integer literals should not start with zero since this denotes that the rest of literal will be
532
532
interpreted as an octal value.
533
- ]]>
533
+ ]]>
534
534
</description >
535
535
<priority >3</priority >
536
536
<example >
@@ -548,10 +548,10 @@ k = i * j; // set k with 80 not 120
548
548
class =" net.sourceforge.pmd.lang.java.rule.basic.AvoidUsingHardCodedIPRule"
549
549
externalInfoUrl =" ${pmd.website.baseurl}/rules/java/basic.html#AvoidUsingHardCodedIP" >
550
550
<description >
551
- <![CDATA[
551
+ <![CDATA[
552
552
Application with hard-coded IP addresses can become impossible to deploy in some cases.
553
553
Externalizing IP adresses is preferable.
554
- ]]>
554
+ ]]>
555
555
</description >
556
556
<priority >3</priority >
557
557
<properties >
@@ -567,7 +567,7 @@ public class Foo {
567
567
</rule >
568
568
569
569
<rule name =" CheckResultSet"
570
- language=" java"
570
+ language=" java"
571
571
since =" 4.1"
572
572
class =" net.sourceforge.pmd.lang.java.rule.basic.CheckResultSetRule"
573
573
message =" Always check the return of one of the navigation method (next,previous,first,last) of a ResultSet."
@@ -633,7 +633,7 @@ int j = -~7;
633
633
</rule >
634
634
635
635
<rule name =" ExtendsObject"
636
- language=" java"
636
+ language=" java"
637
637
since =" 5.0"
638
638
message =" No need to explicitly extend Object."
639
639
class =" net.sourceforge.pmd.lang.rule.XPathRule"
@@ -659,10 +659,10 @@ public class Foo extends Object { // not required
659
659
660
660
<rule name =" CheckSkipResult"
661
661
language =" java"
662
- since =" 5.0"
662
+ since =" 5.0"
663
663
message =" Check the value returned by the skip() method of an InputStream to see if the requested number of bytes has been skipped."
664
664
class =" net.sourceforge.pmd.lang.java.rule.basic.CheckSkipResultRule"
665
- externalInfoUrl =" ${pmd.website.baseurl}/rules/java/basic.html#CheckSkipResult" >
665
+ externalInfoUrl =" ${pmd.website.baseurl}/rules/java/basic.html#CheckSkipResult" >
666
666
<description >The skip() method may skip a smaller number of bytes than requested. Check the returned value to find out if it was the case or not.</description >
667
667
<priority >3</priority >
668
668
<example >
@@ -688,7 +688,7 @@ public class Foo {
688
688
</rule >
689
689
690
690
<rule name =" AvoidBranchingStatementAsLastInLoop"
691
- since =" 5.0"
691
+ since =" 5.0"
692
692
class =" net.sourceforge.pmd.lang.java.rule.basic.AvoidBranchingStatementAsLastInLoopRule"
693
693
message =" Avoid using a branching statement as the last in a loop."
694
694
externalInfoUrl =" ${pmd.website.baseurl}/rules/java/basic.html#AvoidBranchingStatementAsLastInLoop" >
0 commit comments