github / github/codeql

Java: Add common base class for SwitchStmt and SwitchExpr

Ouverte
#3,642 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Java question
Langage dominant
CodeQL
Étoiles
10.1k
Forks
2.1k
Merge moyen
2 j 15 h
PR mergées (30 j)
141

Description

**Description of the issue**
Would it be possible to add a common base class for SwitchStmt and SwitchExpr?
Currently both classes define common predicates and it is often useful to find out whether a switch covers certain values, regardless of whether it is a statement or an expression.
Common predicates:
- `getACase`
- `getAConstCase`
- `getAStmt`
- `getDefaultCase`
- `getExpr`
- `getStmt`

Some built-in QL types and queries would likely profit from this as well (though classes like `ConstSwitchStmt` would have to be redesigned to extend from this new class?).

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.