mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Java: Make JumpStmt a concrete class again
Public abstract classes can be error-prone, when users unintentionally implement a new subclass instead of refining the set of existing subclasses.
This commit is contained in:
@@ -556,8 +556,11 @@ class ThrowStmt extends Stmt, @throwstmt {
|
||||
override string getAPrimaryQlClass() { result = "ThrowStmt" }
|
||||
}
|
||||
|
||||
// Workaround to avoid having to make JumpStmt abstract
|
||||
private class JumpStmt_ = @breakstmt or @yieldstmt or @continuestmt;
|
||||
|
||||
/** A `break`, `yield` or `continue` statement. */
|
||||
abstract class JumpStmt extends Stmt {
|
||||
class JumpStmt extends Stmt, JumpStmt_ {
|
||||
/**
|
||||
* Gets the labeled statement that this `break` or
|
||||
* `continue` statement refers to, if any.
|
||||
|
||||
Reference in New Issue
Block a user