From 5cb827895d3d3774fa9339787fc57626765825f0 Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Mon, 31 Oct 2022 01:02:14 +0100 Subject: [PATCH] fix: use extended modifiers (#249) --- .../analyzer/qodana/rules/UnnecessaryModifier.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/analyzer/qodana/rules/UnnecessaryModifier.java b/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/analyzer/qodana/rules/UnnecessaryModifier.java index 922fb11e2..719cab2a2 100644 --- a/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/analyzer/qodana/rules/UnnecessaryModifier.java +++ b/code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/analyzer/qodana/rules/UnnecessaryModifier.java @@ -46,9 +46,9 @@ public void refactor(ChangeListener listener, CtType type) { if (!hasModifier(ctModifierHandler, modifier)) { continue; } - var modifiers = new HashSet<>(ctModifierHandler.getModifiers()); - modifiers.removeIf(v -> v.toString().equals(modifier.toLowerCase())); - ctModifierHandler.setModifiers(modifiers); + var modifiers = new HashSet<>(ctModifierHandler.getExtendedModifiers()); + modifiers.removeIf(v -> v.getKind().toString().equalsIgnoreCase(modifier)); + ctModifierHandler.setExtendedModifiers(modifiers); listener.setChanged( type.getTopLevelType(), new Change(