forked from phoedos/pmd
Fixed bug 2050064 - False + SuspiciousOctalEscape with backslash literal
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6415 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -12,6 +12,7 @@ Fixed bug 1998185 - BeanMembersShouldSerialize vs @SuppressWarnings("serial")
|
||||
Fixed bug 2002722 - false + in UseStringBufferForStringAppends
|
||||
Fixed bug 2056318 - False positive for AvoidInstantiatingObjectsInLoops
|
||||
Fixed bug 1977438 - False positive for UselessStringValueOf
|
||||
Fixed bug 2050064 - False + SuspiciousOctalEscape with backslash literal
|
||||
Optimizations and false positive fixes in PreserveStackTrace
|
||||
@SuppressWarnings("all") disables all warnings
|
||||
All comment types are now stored in ASTCompilationUnit, not just formal ones
|
||||
|
@ -49,6 +49,32 @@ public class Foo {
|
||||
void bar() {
|
||||
System.out.println("foo = \4008");
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description><![CDATA[
|
||||
[ 2050064 ] False + SuspiciousOctalEscape with backslash literal
|
||||
]]></description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
void bar() {
|
||||
System.out.println("suspicious: \\128");
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description><![CDATA[
|
||||
[ 2050064 ] False + SuspiciousOctalEscape with backslash literal, second test case
|
||||
]]></description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Foo {
|
||||
void bar() {
|
||||
System.out.println("suspicious: \\128 \128");
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
@ -57,6 +57,8 @@ public class SuspiciousOctalEscape extends AbstractRule {
|
||||
addViolation(data, node);
|
||||
}
|
||||
}
|
||||
} else if (first == '\\') {
|
||||
slash++;
|
||||
}
|
||||
|
||||
offset = slash + 1;
|
||||
|
Reference in New Issue
Block a user