Skip to content

Commit bfeaecc

Browse files
authored
Merge pull request github#3507 from aschackmull/java/cleanup-deprecated-overrides
Java: Clean up deprecated overrides.
2 parents 6f03a0b + 9d7329d commit bfeaecc

File tree

2 files changed

+4
-38
lines changed

2 files changed

+4
-38
lines changed

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -151,33 +151,6 @@ class Container extends @container, Top {
151151
* This is the absolute path of the container.
152152
*/
153153
override string toString() { result = getAbsolutePath() }
154-
155-
/**
156-
* DEPRECATED: use `getAbsolutePath()`, `getBaseName()` or `getStem()` instead.
157-
*
158-
* Gets the name of this container.
159-
*/
160-
deprecated string getName() { result = getAbsolutePath() }
161-
162-
/**
163-
* DEPRECATED: use `getBaseName()` or `getStem()` instead.
164-
*
165-
* The short name of this container, excluding its path and (for files) extension.
166-
*
167-
* For folders, the short name includes the extension (if any), so the short name
168-
* of the folder with absolute path `/home/user/.m2` is `.m2`.
169-
*/
170-
deprecated string getShortName() {
171-
folders(this, _, result) or
172-
files(this, _, result, _, _)
173-
}
174-
175-
/**
176-
* DEPRECATED: use `getAbsolutePath()` instead.
177-
*
178-
* Gets the full name of this container, including its path and extension (if any).
179-
*/
180-
deprecated string getFullName() { result = getAbsolutePath() }
181154
}
182155

183156
/** A folder. */
@@ -198,13 +171,6 @@ class File extends Container, @file {
198171

199172
/** Gets the URL of this file. */
200173
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
201-
202-
/**
203-
* DEPRECATED: use `getAbsolutePath()`, `getBaseName()` or `getStem()` instead.
204-
*
205-
* Holds if this file has the specified `name`.
206-
*/
207-
deprecated predicate hasName(string name) { name = this.getAbsolutePath() }
208174
}
209175

210176
/**

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class IfStmt extends ConditionalStmt, @ifstmt {
117117
* Gets the statement that is executed whenever the condition
118118
* of this branch statement evaluates to `true`.
119119
*/
120-
override Stmt getTrueSuccessor() { result = getThen() }
120+
deprecated override Stmt getTrueSuccessor() { result = getThen() }
121121

122122
/** Gets the `else` branch of this `if` statement. */
123123
Stmt getElse() { result.isNthChildOf(this, 2) }
@@ -168,7 +168,7 @@ class ForStmt extends ConditionalStmt, @forstmt {
168168
* Gets the statement that is executed whenever the condition
169169
* of this branch statement evaluates to true.
170170
*/
171-
override Stmt getTrueSuccessor() { result = getStmt() }
171+
deprecated override Stmt getTrueSuccessor() { result = getStmt() }
172172

173173
/**
174174
* Gets a variable that is used as an iteration variable: it is defined,
@@ -228,7 +228,7 @@ class WhileStmt extends ConditionalStmt, @whilestmt {
228228
* Gets the statement that is executed whenever the condition
229229
* of this branch statement evaluates to true.
230230
*/
231-
override Stmt getTrueSuccessor() { result = getStmt() }
231+
deprecated override Stmt getTrueSuccessor() { result = getStmt() }
232232

233233
/** Gets a printable representation of this statement. May include more detail than `toString()`. */
234234
override string pp() { result = "while (...) " + this.getStmt().pp() }
@@ -249,7 +249,7 @@ class DoStmt extends ConditionalStmt, @dostmt {
249249
* Gets the statement that is executed whenever the condition
250250
* of this branch statement evaluates to `true`.
251251
*/
252-
override Stmt getTrueSuccessor() { result = getStmt() }
252+
deprecated override Stmt getTrueSuccessor() { result = getStmt() }
253253

254254
/** Gets a printable representation of this statement. May include more detail than `toString()`. */
255255
override string pp() { result = "do " + this.getStmt().pp() + " while (...)" }

0 commit comments

Comments
 (0)