Skip to content

Commit 21ec83a

Browse files
committed
Java: Add MaD support for With[out]Element.
1 parent 2b74144 commit 21ec83a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ predicate neutralSummaryElement(SummarizedCallableBase c, string provenance) {
170170
bindingset[c]
171171
SummaryComponent interpretComponentSpecific(AccessPathToken c) {
172172
exists(Content content | parseContent(c, content) and result = SummaryComponent::content(content))
173+
or
174+
c = "WithoutElement" and result = SummaryComponent::withoutContent(any(CollectionContent cc))
175+
or
176+
c = "WithElement" and result = SummaryComponent::withContent(any(CollectionContent cc))
173177
}
174178

175179
/** Gets the summary component for specification component `c`, if any. */
@@ -196,6 +200,10 @@ private string getContentSpecific(Content c) {
196200
/** Gets the textual representation of the content in the format used for MaD models. */
197201
string getMadRepresentationSpecific(SummaryComponent sc) {
198202
exists(Content c | sc = TContentSummaryComponent(c) and result = getContentSpecific(c))
203+
or
204+
sc = TWithoutContentSummaryComponent(_) and result = "WithoutElement"
205+
or
206+
sc = TWithContentSummaryComponent(_) and result = "WithElement"
199207
}
200208

201209
bindingset[pos]

0 commit comments

Comments
 (0)