Skip to content

Commit 413ac4e

Browse files
authored
Merge pull request github#6684 from owen-mc/java/model/apache-collections-subpackages
Java: model remaining subpackages of Apache Commons Collections
2 parents cec6cd0 + 39a12a8 commit 413ac4e

File tree

139 files changed

+7708
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+7708
-155
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* Added models for the subpackages of Apache Commons Collections. This may lead to more results from any query using data-flow analysis where a relevant path uses one of these container types.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ private class ContainerFlowSummaries extends SummaryModelCsv {
9595
override predicate row(string row) {
9696
row =
9797
[
98+
"java.lang;Object;true;clone;;;MapKey of Argument[-1];MapKey of ReturnValue;value",
99+
"java.lang;Object;true;clone;;;MapValue of Argument[-1];MapValue of ReturnValue;value",
100+
"java.lang;Object;true;clone;;;Element of Argument[-1];Element of ReturnValue;value",
98101
"java.util;Map$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
99102
"java.util;Map$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
100103
"java.util;Map$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",

java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll

Lines changed: 578 additions & 3 deletions
Large diffs are not rendered by default.

java/ql/test/library-tests/frameworks/apache-collections/Test.java

Lines changed: 3723 additions & 146 deletions
Large diffs are not rendered by default.

java/ql/test/library-tests/frameworks/apache-collections/test.ql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import java
2-
import semmle.code.java.dataflow.DataFlow
3-
import semmle.code.java.dataflow.ExternalFlow
4-
import semmle.code.java.dataflow.TaintTracking
52
import TestUtilities.InlineFlowTest
63

74
class SummaryModelTest extends SummaryModelCsv {
85
override predicate row(string row) {
96
row =
107
[
118
//"package;type;overrides;name;signature;ext;inputspec;outputspec;kind",
12-
// This is temporarily modelled for the helper function newEnumerationWithElement, until the relevant package is modelled
13-
"org.apache.commons.collections4.iterators;IteratorEnumeration;true;IteratorEnumeration;;;Element of Argument[0];Element of Argument[-1];value",
149
"generatedtest;Test;false;newRBWithMapValue;;;Argument[0];MapValue of ReturnValue;value",
1510
"generatedtest;Test;false;newRBWithMapKey;;;Argument[0];MapKey of ReturnValue;value"
1611
]

java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/BoundedCollection.java

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/BoundedMap.java

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/SortedBidiMap.java

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/bag/AbstractBagDecorator.java

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/bag/AbstractMapBag.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)