Skip to content

Commit eaaa4f2

Browse files
committed
java dbg
1 parent 2395667 commit eaaa4f2

File tree

4 files changed

+55
-6
lines changed

4 files changed

+55
-6
lines changed

java/ql/lib/ext/org.apache.commons.collections4.map.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ extensions:
103103
- ["org.apache.commons.collections4.map", "MultiValueMap", True, "putAll", "(Map)", "", "Argument[0].MapKey", "Argument[this].MapKey", "value", "manual"]
104104
- ["org.apache.commons.collections4.map", "MultiValueMap", True, "putAll", "(Map)", "", "Argument[0].MapValue", "Argument[this].MapValue", "value", "manual"]
105105
- ["org.apache.commons.collections4.map", "MultiValueMap", True, "values", "", "", "Argument[this].MapValue.Element", "ReturnValue.Element", "value", "manual"]
106-
- ["org.apache.commons.collections4.map", "MultiValueMap", True, "values", "", "", "Argument[this].MapValue", "ReturnValue.Element", "value", "manual"]
106+
#- ["org.apache.commons.collections4.map", "MultiValueMap", True, "values", "", "", "Argument[this].MapValue", "ReturnValue.Element", "value", "manual"]
107107
- ["org.apache.commons.collections4.map", "PassiveExpiringMap", True, "PassiveExpiringMap", "(PassiveExpiringMap$ExpirationPolicy,Map)", "", "Argument[1].MapKey", "Argument[this].MapKey", "value", "manual"]
108108
- ["org.apache.commons.collections4.map", "PassiveExpiringMap", True, "PassiveExpiringMap", "(PassiveExpiringMap$ExpirationPolicy,Map)", "", "Argument[1].MapValue", "Argument[this].MapValue", "value", "manual"]
109109
- ["org.apache.commons.collections4.map", "PassiveExpiringMap", True, "PassiveExpiringMap", "(Map)", "", "Argument[0].MapKey", "Argument[this].MapKey", "value", "manual"]

java/ql/lib/ext/org.apache.commons.collections4.model.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ extensions:
290290
- ["org.apache.commons.collections4", "MultiMap", True, "get", "", "", "Argument[this].MapValue", "ReturnValue", "value", "manual"]
291291
- ["org.apache.commons.collections4", "MultiMap", True, "put", "", "", "Argument[0]", "Argument[this].MapKey", "value", "manual"]
292292
- ["org.apache.commons.collections4", "MultiMap", True, "put", "", "", "Argument[1]", "Argument[this].MapValue.Element", "value", "manual"]
293-
- ["org.apache.commons.collections4", "MultiMap", True, "put", "", "", "Argument[this].MapValue", "ReturnValue", "value", "manual"]
294-
- ["org.apache.commons.collections4", "MultiMap", True, "put", "", "", "Argument[1]", "Argument[this].MapValue", "value", "manual"]
293+
# - ["org.apache.commons.collections4", "MultiMap", True, "put", "", "", "Argument[this].MapValue", "ReturnValue", "value", "manual"]
294+
# - ["org.apache.commons.collections4", "MultiMap", True, "put", "", "", "Argument[1]", "Argument[this].MapValue", "value", "manual"]
295295
- ["org.apache.commons.collections4", "MultiMap", True, "values", "", "", "Argument[this].MapValue.Element", "ReturnValue.Element", "value", "manual"]
296-
- ["org.apache.commons.collections4", "MultiMap", True, "values", "", "", "Argument[this].MapValue", "ReturnValue.Element", "value", "manual"]
296+
# - ["org.apache.commons.collections4", "MultiMap", True, "values", "", "", "Argument[this].MapValue", "ReturnValue.Element", "value", "manual"]
297297
- ["org.apache.commons.collections4", "MultiMapUtils", True, "emptyIfNull", "", "", "Argument[0]", "ReturnValue", "value", "manual"]
298298
- ["org.apache.commons.collections4", "MultiMapUtils", True, "getCollection", "", "", "Argument[0].MapValue", "ReturnValue", "value", "manual"]
299299
- ["org.apache.commons.collections4", "MultiMapUtils", True, "getValuesAsBag", "", "", "Argument[0].MapValue.Element", "ReturnValue.Element", "value", "manual"]

java/ql/lib/ext/org.apache.commons.collections4.set.model.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ extensions:
2020
- ["org.apache.commons.collections4.set", "CompositeSet$SetMutator", True, "addAll", "", "", "Argument[2].Element", "Argument[0].Element", "value", "manual"]
2121
- ["org.apache.commons.collections4.set", "CompositeSet$SetMutator", True, "addAll", "", "", "Argument[2].Element", "Argument[1].Element.Element", "value", "manual"]
2222
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "add", "", "", "Argument[1]", "Argument[this].Element", "value", "manual"]
23-
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "add", "", "", "Argument[0]", "Argument[this].Element", "value", "manual"]
23+
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "add", "(Object)", "", "Argument[0]", "Argument[this].Element", "value", "manual"]
2424
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "addAll", "", "", "Argument[1].Element", "Argument[this].Element", "value", "manual"]
25-
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "addAll", "", "", "Argument[0].Element", "Argument[this].Element", "value", "manual"]
25+
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "addAll", "(Collection)", "", "Argument[0].Element", "Argument[this].Element", "value", "manual"]
2626
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "asList", "", "", "Argument[this].Element", "ReturnValue.Element", "value", "manual"]
2727
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "get", "", "", "Argument[this].Element", "ReturnValue", "value", "manual"]
2828
- ["org.apache.commons.collections4.set", "ListOrderedSet", True, "listOrderedSet", "(List)", "", "Argument[0].Element", "ReturnValue.Element", "value", "manual"]

java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,55 @@ module Private {
400400
)
401401
}
402402

403+
private predicate testsummaryElement(
404+
Input::SummarizedCallableBase c, string namespace, string type, boolean subtypes, string name,
405+
string signature, string ext, string originalInput, string originalOutput, string kind,
406+
string provenance, string model, boolean isExact
407+
) {
408+
exists(string input, string output, Callable baseCallable |
409+
summaryModel(namespace, type, subtypes, name, signature, ext, originalInput, originalOutput,
410+
kind, provenance, model) and
411+
baseCallable = interpretElement(namespace, type, subtypes, name, signature, ext, isExact) and
412+
(
413+
c.asCallable() = baseCallable and input = originalInput and output = originalOutput
414+
or
415+
correspondingKotlinParameterDefaultsArgSpec(baseCallable, c.asCallable(), originalInput,
416+
input) and
417+
correspondingKotlinParameterDefaultsArgSpec(baseCallable, c.asCallable(), originalOutput,
418+
output)
419+
)
420+
)
421+
}
422+
423+
private predicate testsummaryElement2(
424+
string namespace, string type, boolean subtypes, string name, string signature, string ext,
425+
string originalInput, string originalOutput, string kind, string provenance, string model,
426+
string namespace2, string type2
427+
) {
428+
exists(Input::SummarizedCallableBase c |
429+
testsummaryElement(c, namespace2, type2, _, _, _, ext, originalInput, originalOutput, kind,
430+
provenance, model, false) and
431+
testsummaryElement(c, namespace, type, subtypes, name, _, _, _, _, _, provenance, _, true) and
432+
signature = paramsString(c.asCallable()) and
433+
not testsummaryElement(c, _, _, _, _, _, _, originalInput, originalOutput, kind, provenance,
434+
_, true)
435+
)
436+
}
437+
438+
private string getAMissingManualModel(string namespace2, string type2) {
439+
exists(
440+
string namespace, string type, boolean subtypes, string name, string signature, string ext,
441+
string originalInput, string originalOutput, string kind, string provenance, string model
442+
|
443+
testsummaryElement2(namespace, type, subtypes, name, signature, ext, originalInput,
444+
originalOutput, kind, provenance, model, namespace2, type2) and
445+
result =
446+
"- [\"" + namespace + "\", \"" + type + "\", True, \"" + name + "\", \"" + signature +
447+
"\", \"\", \"" + originalInput + "\", \"" + originalOutput + "\", \"" + kind + "\", \"" +
448+
provenance + "\"]"
449+
)
450+
}
451+
403452
predicate neutralElement = Input::neutralElement/4;
404453
}
405454

0 commit comments

Comments
 (0)