forked from phoedos/pmd
Merge branch 'pr-1891'
This commit is contained in:
@ -46,6 +46,8 @@ datetime field.
|
||||
|
||||
### Fixed Issues
|
||||
|
||||
* apex
|
||||
* [#1664](https://github.com/pmd/pmd/issues/1664): \[apex] False positive ApexSharingViolationsRule, unsupported Apex feature
|
||||
* java
|
||||
* [#1848](https://github.com/pmd/pmd/issues/1848): \[java] Local classes should preserve their modifiers
|
||||
* java-bestpractices
|
||||
|
@ -96,7 +96,8 @@ public class ApexSharingViolationsRule extends AbstractApexRule {
|
||||
* @return
|
||||
*/
|
||||
private boolean isSharingPresent(ASTUserClass node) {
|
||||
return node.getModifiers().isWithoutSharing() || node.getModifiers().isWithSharing();
|
||||
return node.getModifiers().isWithoutSharing() || node.getModifiers().isWithSharing()
|
||||
|| node.getModifiers().isInheritedSharing();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -97,4 +97,15 @@ public without sharing class Foo {
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>Apex class with inherited sharing doing a safe SOQL query</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public inherited sharing class MyClass {
|
||||
public List<Contact> getAllTheSecrets(){
|
||||
return [SELECT Name FROM Contact];
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
|
Reference in New Issue
Block a user