Skip to content

Commit a8c10e2

Browse files
committed
Java: Delete old deprecated code.
1 parent 247848c commit a8c10e2

File tree

4 files changed

+6
-154
lines changed

4 files changed

+6
-154
lines changed

java/ql/src/semmle/code/java/Expr.qll

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -798,16 +798,6 @@ class LogicExpr extends Expr {
798798
* `<=`, `>=`, `<` or `>`.
799799
*/
800800
abstract class ComparisonExpr extends BinaryExpr {
801-
/**
802-
* DEPRECATED: use `getLesserOperand()` instead.
803-
*/
804-
deprecated Expr getLesser() { result = getLesserOperand() }
805-
806-
/**
807-
* DEPRECATED: use `getGreaterOperand()` instead.
808-
*/
809-
deprecated Expr getGreater() { result = getGreaterOperand() }
810-
811801
/**
812802
* Gets the lesser operand of this comparison expression.
813803
*

java/ql/src/semmle/code/java/Type.qll

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,15 @@ private predicate typeArgumentContainsAux1(RefType s, RefType t, int n) {
216216
|
217217
exists(RefType tUpperBound | tUpperBound = t.(Wildcard).getUpperBound().getType() |
218218
// ? extends T <= ? extends S if T <: S
219-
hasSubtypeStar0(s.(Wildcard).getUpperBound().getType(), tUpperBound)
219+
hasSubtypeStar(s.(Wildcard).getUpperBound().getType(), tUpperBound)
220220
or
221221
// ? extends T <= ?
222222
s.(Wildcard).isUnconstrained()
223223
)
224224
or
225225
exists(RefType tLowerBound | tLowerBound = t.(Wildcard).getLowerBound().getType() |
226226
// ? super T <= ? super S if s <: T
227-
hasSubtypeStar0(tLowerBound, s.(Wildcard).getLowerBound().getType())
227+
hasSubtypeStar(tLowerBound, s.(Wildcard).getLowerBound().getType())
228228
or
229229
// ? super T <= ?
230230
s.(Wildcard).isUnconstrained()
@@ -237,10 +237,10 @@ private predicate typeArgumentContainsAux1(RefType s, RefType t, int n) {
237237
s = t
238238
or
239239
// T <= ? extends T
240-
hasSubtypeStar0(s.(Wildcard).getUpperBound().getType(), t)
240+
hasSubtypeStar(s.(Wildcard).getUpperBound().getType(), t)
241241
or
242242
// T <= ? super T
243-
hasSubtypeStar0(t, s.(Wildcard).getLowerBound().getType())
243+
hasSubtypeStar(t, s.(Wildcard).getLowerBound().getType())
244244
)
245245
}
246246

@@ -249,17 +249,12 @@ private predicate wildcardExtendsObject(Wildcard wc) {
249249
wc.getUpperBound().getType() instanceof TypeObject
250250
}
251251

252-
/**
253-
* DEPRECATED: Use `hasSubtype*` instead.
254-
*/
255-
deprecated predicate hasSubtypeStar(RefType t, RefType sub) { hasSubtype*(t, sub) }
256-
257-
private predicate hasSubtypeStar0(RefType t, RefType sub) {
252+
private predicate hasSubtypeStar(RefType t, RefType sub) {
258253
sub = t
259254
or
260255
hasSubtype(t, sub)
261256
or
262-
exists(RefType mid | hasSubtypeStar0(t, mid) and hasSubtype(mid, sub))
257+
exists(RefType mid | hasSubtypeStar(t, mid) and hasSubtype(mid, sub))
263258
}
264259

265260
/** Holds if type `t` declares member `m`. */

java/ql/src/semmle/code/java/dataflow/FlowSources.qll

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -150,70 +150,6 @@ abstract class UserInput extends DataFlow::Node { }
150150
*/
151151
deprecated class RemoteUserInput extends UserInput {
152152
RemoteUserInput() { this instanceof RemoteFlowSource }
153-
154-
/**
155-
* DEPRECATED: Use a configuration with a defined sink instead.
156-
*
157-
* Holds if taint can flow from this `RemoteUserInput` to `sink`.
158-
*
159-
* In addition to the basic taint flow, this allows a path to end in a number
160-
* of steps through instance fields.
161-
*/
162-
deprecated predicate flowsTo(DataFlow::Node sink) { remoteUserInputFlow(this, sink) }
163-
}
164-
165-
/**
166-
* Holds if taint can flow from `node1` to `node2` in either one local step or
167-
* through an instance field.
168-
*/
169-
private predicate localInstanceFieldStep(DataFlow::Node node1, DataFlow::Node node2) {
170-
TaintTracking::localTaintStep(node1, node2)
171-
or
172-
exists(InstanceField field |
173-
node1.asExpr() = field.getAnAssignedValue()
174-
or
175-
exists(Assignment assign | assign.getRhs() = node1.asExpr() |
176-
assign.getDest().(ArrayAccess).getArray() = field.getAnAccess()
177-
)
178-
|
179-
node2.asExpr() = field.getAnAccess()
180-
)
181-
}
182-
183-
private module RemoteUserInputFlow {
184-
private import semmle.code.java.dataflow.internal.DataFlowImplDepr
185-
private import semmle.code.java.security.SecurityTests
186-
private import semmle.code.java.security.Validation
187-
188-
deprecated class RemoteUserInputConfig extends Configuration {
189-
RemoteUserInputConfig() { this = "FlowSources.qll:RemoteUserInputConfig" }
190-
191-
override predicate isSource(DataFlow::Node source) { source instanceof RemoteUserInput }
192-
193-
override predicate isSink(DataFlow::Node sink) { any() }
194-
195-
override int fieldFlowBranchLimit() { result = 0 }
196-
197-
override predicate isBarrier(DataFlow::Node node) {
198-
// Ignore paths through test code.
199-
node.getEnclosingCallable().getDeclaringType() instanceof NonSecurityTestClass or
200-
exists(ValidatedVariable var | node.asExpr() = var.getAnAccess())
201-
}
202-
203-
override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
204-
TaintTracking::localAdditionalTaintStep(node1, node2)
205-
}
206-
}
207-
}
208-
209-
cached
210-
deprecated private predicate remoteUserInputFlow(RemoteUserInput src, DataFlow::Node sink) {
211-
any(RemoteUserInputFlow::RemoteUserInputConfig config).hasFlow(src, sink)
212-
or
213-
exists(DataFlow::Node mid |
214-
remoteUserInputFlow(src, mid) and
215-
localInstanceFieldStep(mid, sink)
216-
)
217153
}
218154

219155
/** Input that may be controlled by a local user. */

java/ql/src/semmle/code/java/dataflow/Guards.qll

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)