"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/security/xml/ApexCRUDViolation.xml" between
pmd-src-6.37.0.zip and pmd-src-6.38.0.zip

About: PMD is a source code analyzer for Java, JavaScript, XML and others. It finds unused variables, empty catch blocks, unnecessary object creation, and so forth. Sources (Java).

ApexCRUDViolation.xml  (pmd-src-6.37.0):ApexCRUDViolation.xml  (pmd-src-6.38.0)
skipping to change at line 1053 skipping to change at line 1053
void bar() { void bar() {
for (Account a : [SELECT Id FROM Account]) { for (Account a : [SELECT Id FROM Account]) {
} }
} }
} }
]]></code> ]]></code>
</test-code> </test-code>
<test-code> <test-code>
<description>No CRUD check inside for-each loop</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
public class Foo {
void bar() {
Id[] accIds = new List<Id>();
for (Id accId : accIds) {
Account acc = [SELECT Id FROM Account WHERE Id = :accId];
}
}
}
]]></code>
</test-code>
<test-code>
<description>Proper CRUD check inside for-each loop</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
void bar() {
Id[] accIds = new List<Id>();
if (Account.sObjectType.getDescribe().isAccessible()) {
for (Id accId : accIds) {
Account a = [SELECT Id FROM Account WHERE Id = :accId];
}
}
}
}
]]></code>
</test-code>
<test-code>
<description>Proper CRUD check in SOQL for-loop with security enforced</ description> <description>Proper CRUD check in SOQL for-loop with security enforced</ description>
<expected-problems>0</expected-problems> <expected-problems>0</expected-problems>
<code><![CDATA[ <code><![CDATA[
public class Foo { public class Foo {
void bar() { void bar() {
for (Account a : [SELECT Id FROM Account WITH SECURITY_ENFORCED]) { for (Account a : [SELECT Id FROM Account WITH SECURITY_ENFORCED]) {
} }
} }
} }
 End of changes. 1 change blocks. 
0 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)