Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61324f0

Browse files
committed
Java 12: enhanced QLDoc for preview features
1 parent d4e013b commit 61324f0

2 files changed

Lines changed: 40 additions & 8 deletions

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,11 @@ class ConditionalExpr extends Expr, @conditionalexpr {
10931093
override string toString() { result = "...?...:..." }
10941094
}
10951095

1096-
/** A `switch` expression. */
1096+
/**
1097+
* DEPRECATED: Preview feature in Java 12. Subject to removal in a future release.
1098+
*
1099+
* A `switch` expression.
1100+
*/
10971101
deprecated class SwitchExpr extends Expr, @switchexpr {
10981102
/** Gets an immediate child statement of this `switch` expression. */
10991103
Stmt getAStmt() { result.getParent() = this }

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

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,18 @@ class SwitchCase extends Stmt, @case {
408408
/** Gets the switch statement to which this case belongs, if any. */
409409
SwitchStmt getSwitch() { result.getACase() = this }
410410

411-
/** Gets the switch expression to which this case belongs, if any. */
411+
/**
412+
* DEPRECATED: Preview feature in Java 12. Subject to removal in a future release.
413+
*
414+
* Gets the switch expression to which this case belongs, if any.
415+
*/
412416
deprecated SwitchExpr getSwitchExpr() { result.getACase() = this }
413417

414-
/** Holds if this `case` is a switch labeled rule of the form `... -> ...`. */
418+
/**
419+
* DEPRECATED: Preview feature in Java 12. Subject to removal in a future release.
420+
*
421+
* Holds if this `case` is a switch labeled rule of the form `... -> ...`.
422+
*/
415423
deprecated predicate isRule() {
416424
exists(Expr e | e.getParent() = this | e.getIndex() = -1)
417425
or
@@ -426,13 +434,25 @@ class ConstCase extends SwitchCase {
426434
/** Gets the `case` constant at index 0. */
427435
Expr getValue() { result.getParent() = this and result.getIndex() = 0 }
428436

429-
/** Gets the `case` constant at the specified index. */
437+
/**
438+
* DEPRECATED: Preview feature in Java 12. Subject to removal in a future release.
439+
*
440+
* Gets the `case` constant at the specified index.
441+
*/
430442
deprecated Expr getValue(int i) { result.getParent() = this and result.getIndex() = i and i >= 0 }
431443

432-
/** Gets the expression on the right-hand side of the arrow, if any. */
444+
/**
445+
* DEPRECATED: Preview feature in Java 12. Subject to removal in a future release.
446+
*
447+
* Gets the expression on the right-hand side of the arrow, if any.
448+
*/
433449
deprecated Expr getRuleExpression() { result.getParent() = this and result.getIndex() = -1 }
434450

435-
/** Gets the statement on the right-hand side of the arrow, if any. */
451+
/**
452+
* DEPRECATED: Preview feature in Java 12. Subject to removal in a future release.
453+
*
454+
* Gets the statement on the right-hand side of the arrow, if any.
455+
*/
436456
deprecated Stmt getRuleStatement() { result.getParent() = this and result.getIndex() = -1 }
437457

438458
/** Gets a printable representation of this statement. May include more detail than `toString()`. */
@@ -572,10 +592,18 @@ class BreakStmt extends Stmt, @breakstmt {
572592
/** Holds if this `break` statement has an explicit label. */
573593
predicate hasLabel() { exists(string s | s = this.getLabel()) }
574594

575-
/** Gets the value of this `break` statement, if any. */
595+
/**
596+
* DEPRECATED: Preview feature in Java 12. Subject to removal in a future release.
597+
*
598+
* Gets the value of this `break` statement, if any.
599+
*/
576600
deprecated Expr getValue() { result.getParent() = this }
577601

578-
/** Holds if this `break` statement has a value. */
602+
/**
603+
* DEPRECATED: Preview feature in Java 12. Subject to removal in a future release.
604+
*
605+
* Holds if this `break` statement has a value.
606+
*/
579607
deprecated predicate hasValue() { exists(Expr e | e.getParent() = this) }
580608

581609
/** Gets a printable representation of this statement. May include more detail than `toString()`. */

0 commit comments

Comments
 (0)