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:
Marcono1234
2022-04-10 17:54:47 +02:00
parent a93b4ed0f2
commit 348a186df8

View File

@@ -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.