-
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy path1.1-Source.ql
More file actions
34 lines (29 loc) · 926 Bytes
/
1.1-Source.ql
File metadata and controls
34 lines (29 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
*@name Source
*@derscription
*/
import java
import semmle.code.java.dataflow.DataFlow
/*
Map overrides of isValid method from ConstraintValidator
*/
class ConstraintValidator extends RefType {
ConstraintValidator() {
this.hasQualifiedName("javax.validation", "ConstraintValidator")
}
}
class ConstraintValidatorIsValid extends Method {
ConstraintValidatorIsValid() {
this.getName() = "isValid" and
this.getDeclaringType().getASourceSupertype() instanceof ConstraintValidator
and this.isOverridable()
// this.getASourceOverriddenMethod().getDeclaringType() instanceof ConstraintValidator
}
}
predicate isSource(DataFlow::Node source) {
exists(ConstraintValidatorIsValid isValidMethod |
source.asParameter() = isValidMethod.getParameter(0)
)
}
//There has to be a query in scope even when you use Quick Evaluation
select "Quick-eval isSource"