Skip to content

Commit

Permalink
Use only supported AST levels in ASTView
Browse files Browse the repository at this point in the history
Ensure that only AST levels supported by the compiler are used.
  • Loading branch information
akurtakov committed Jan 21, 2025
1 parent daaa3f3 commit 8fee6c8
Showing 1 changed file with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,6 @@ private boolean isInSwitchExpression(YieldStatement node) {

private IDialogSettings fDialogSettings;


@SuppressWarnings("incomplete-switch")
public ASTView() {
fSuperListener= null;
fDialogSettings= ASTViewPlugin.getDefault().getDialogSettings();
Expand All @@ -503,27 +501,8 @@ public ASTView() {
fCurrentASTLevel= AST.getJLSLatest();
try {
int level= fDialogSettings.getInt(SETTINGS_JLS);
switch (level) {
case JLS2:
case JLS3:
case JLS4:
case JLS8:
case JLS9:
case JLS10:
case JLS11:
case JLS12:
case JLS13:
case JLS14:
case JLS15:
case JLS16:
case JLS17:
case JLS18:
case JLS19:
case JLS20:
case JLS21:
case JLS22:
case JLS23:
fCurrentASTLevel= level;
if(AST.isSupportedVersion(level)) {
fCurrentASTLevel = level;
}
} catch (NumberFormatException e) {
// ignore
Expand Down

0 comments on commit 8fee6c8

Please sign in to comment.