Skip to content

Commit e608c53

Browse files
committed
Java: Follow-up changes
1 parent aa83cc1 commit e608c53

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

java/ql/src/semmle/code/java/dataflow/internal/DataFlowPrivate.qll

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ private predicate instanceFieldAssign(Expr src, FieldAccess fa) {
129129
)
130130
}
131131

132-
/**
133-
* Gets an upper bound on the type of `f`.
134-
*/
135-
private Type getFieldTypeBound(Field f) {
136-
fieldTypeFlow(f, result, _)
137-
or
138-
not fieldTypeFlow(f, _, _) and result = f.getType()
139-
}
140-
141132
private newtype TContent =
142133
TFieldContent(InstanceField f) or
143134
TCollectionContent() or
@@ -154,12 +145,6 @@ class Content extends TContent {
154145
predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
155146
path = "" and sl = 0 and sc = 0 and el = 0 and ec = 0
156147
}
157-
158-
/** Gets the erased type of the object containing this content. */
159-
abstract DataFlowType getContainerType();
160-
161-
/** Gets the erased type of this content. */
162-
abstract DataFlowType getType();
163148
}
164149

165150
private class FieldContent extends Content, TFieldContent {
@@ -174,26 +159,14 @@ private class FieldContent extends Content, TFieldContent {
174159
override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
175160
f.getLocation().hasLocationInfo(path, sl, sc, el, ec)
176161
}
177-
178-
override DataFlowType getContainerType() { result = getErasedRepr(f.getDeclaringType()) }
179-
180-
override DataFlowType getType() { result = getErasedRepr(getFieldTypeBound(f)) }
181162
}
182163

183164
private class CollectionContent extends Content, TCollectionContent {
184165
override string toString() { result = "collection" }
185-
186-
override DataFlowType getContainerType() { none() }
187-
188-
override DataFlowType getType() { none() }
189166
}
190167

191168
private class ArrayContent extends Content, TArrayContent {
192169
override string toString() { result = "array" }
193-
194-
override DataFlowType getContainerType() { none() }
195-
196-
override DataFlowType getType() { none() }
197170
}
198171

199172
/**

java/ql/test/library-tests/dataflow/getter/getter.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import semmle.code.java.dataflow.internal.DataFlowImplSpecific::Private
66
from Node n1, Content f, Node n2
77
where
88
read(n1, f, n2) or
9-
argumentValueFlowsThrough(n1, TContentSome(f), n2)
9+
argumentValueFlowsThrough(n1, TContentSome(f), n2, _, _)
1010
select n1, n2, f

0 commit comments

Comments
 (0)