mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
Add visibility constraints; Fix non-compliant code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class DateFormattingThread implements Runnable {
|
||||
private static DateFormat dateF = new SimpleDateFormat("yyyyMMdd"); // Static field declared
|
||||
public static DateFormat dateF = new SimpleDateFormat("yyyyMMdd"); // Static field declared
|
||||
|
||||
public void run() {
|
||||
for(int i=0; i < 10; i++){
|
||||
|
||||
@@ -16,6 +16,7 @@ import java
|
||||
from Field f, Class dateFormat
|
||||
where
|
||||
f.isStatic() and
|
||||
(f.isPublic() or f.isProtected()) and
|
||||
dateFormat.hasQualifiedName("java.text", "DateFormat") and
|
||||
f.getType().(RefType).hasSupertype*(dateFormat) and
|
||||
exists(MethodAccess m | m.getQualifier().(VarAccess).getVariable() = f)
|
||||
|
||||
Reference in New Issue
Block a user