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