Skip to content

Commit

Permalink
Java 14: add PREVIEW FEATURE notes to QLDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
yo-h committed Apr 8, 2020
1 parent 697b273 commit 9a79e3b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions java/ql/src/semmle/code/java/Expr.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1136,10 +1136,18 @@ class InstanceOfExpr extends Expr, @instanceofexpr {
else result.isNthChildOf(this, 0)
}

/** Holds if this `instanceof` expression uses pattern matching. */
/**
* PREVIEW FEATURE in Java 14. Subject to removal in a future release.
*
* Holds if this `instanceof` expression uses pattern matching.
*/
predicate isPattern() { exists(getLocalVariableDeclExpr()) }

/** Gets the local variable declaration of this `instanceof` expression if pattern matching is used. */
/**
* PREVIEW FEATURE in Java 14. Subject to removal in a future release.
*
* Gets the local variable declaration of this `instanceof` expression if pattern matching is used.
*/
LocalVariableDeclExpr getLocalVariableDeclExpr() { result.isNthChildOf(this, 0) }

/** Gets the access to the type on the right-hand side of the `instanceof` operator. */
Expand Down
6 changes: 5 additions & 1 deletion java/ql/src/semmle/code/java/Type.qll
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,11 @@ class Class extends RefType, @class {
}
}

/** A record declaration. */
/**
* PREVIEW FEATURE in Java 14. Subject to removal in a future release.
*
* A record declaration.
*/
class Record extends Class {
Record() { isRecord(this) }
}
Expand Down

0 comments on commit 9a79e3b

Please sign in to comment.