mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Java: use getField() instead of getAllFields() to get enum constants
GitOrigin-RevId: b16e164b1f42e642d6422de7c8badbb677c20e0b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2a0ccb7079
commit
3d38ad9549
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2017 Dave Griffith, Bas Leijdekkers
|
||||
* Copyright 2003-2024 Dave Griffith, Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -90,7 +90,7 @@ public final class EnumSwitchStatementWhichMissesCasesInspection extends Abstrac
|
||||
if (expression == null) return;
|
||||
final PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(expression.getType());
|
||||
if (aClass == null || !aClass.isEnum()) return;
|
||||
Set<String> constants = StreamEx.of(aClass.getAllFields()).select(PsiEnumConstant.class).map(PsiEnumConstant::getName)
|
||||
Set<String> constants = StreamEx.of(aClass.getFields()).select(PsiEnumConstant.class).map(PsiEnumConstant::getName)
|
||||
.toCollection(LinkedHashSet::new);
|
||||
if (constants.isEmpty()) return;
|
||||
boolean hasDefault = false;
|
||||
|
||||
Reference in New Issue
Block a user