diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/AvoidUsingOctalValuesTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/AvoidUsingOctalValuesTest.java index 4d9855ef3f..3072cbbba0 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/AvoidUsingOctalValuesTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/AvoidUsingOctalValuesTest.java @@ -20,6 +20,7 @@ public class AvoidUsingOctalValuesTest extends SimpleAggregatorTst { new TestDescriptor(TEST2, "OK, hex value", 0, rule), new TestDescriptor(TEST3, "OK, long value", 0, rule), new TestDescriptor(TEST4, "OK, double value", 0, rule), + new TestDescriptor(TEST5, "OK, double value", 0, rule), }); } @@ -43,4 +44,9 @@ public class AvoidUsingOctalValuesTest extends SimpleAggregatorTst { " double d = 0.1;" + PMD.EOL + "}"; + private static final String TEST5 = + "public class Foo {" + PMD.EOL + + " float f = 0f;" + PMD.EOL + + "}"; + } diff --git a/pmd/rulesets/basic.xml b/pmd/rulesets/basic.xml index 4f595b13bf..e664303578 100644 --- a/pmd/rulesets/basic.xml +++ b/pmd/rulesets/basic.xml @@ -1087,26 +1087,12 @@ public class Test { Integer literals should not start with zero. Zero means that the rest of literal will be interpreted as an octal value. - - - -1] - [not(contains(@Image, '.'))] - [not(substring(@Image, 2, 1) = 'x')] - [not(substring(@Image, 2, 1) = 'L')] -]]> - - - 3