[apex] Add test case, refs #776

Note: only solution right now is supressing the rule for the string.
This commit is contained in:
Andreas Dangel
2018-04-24 22:22:48 +02:00
parent ffd88ef11e
commit 6cb0b47ef5

View File

@ -74,4 +74,21 @@ public class Foo {
}
]]></code>
</test-code>
<test-code>
<description>[apex] AvoidHardcodingId false positives #776</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
void foo() {
// this is a false positive, we can't say, whether it's a salesforce id or not
@SuppressWarnings('PMD.AvoidHardcodingId')
String IMEI__c = '359040082913024';
// now the 6th character is non-0, definitive not a salesforce id
String IMEI2__c = '359041082913024';
}
}
]]></code>
</test-code>
</test-data>