From f5c0a858dd8355f6d2ca31ac9f9562e9c13c9483 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 23 May 2011 15:51:37 +0400 Subject: [PATCH] simplify @SuppressWarnings (IDEA-69286) --- .../daemon/impl/actions/SuppressAllForClassFix.java | 4 ++-- .../intellij/codeInsight/daemon/impl/actions/SuppressFix.java | 2 +- .../quickFix/suppress15Inspections/after1.java | 2 +- .../quickFix/suppress15Inspections/after2.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressAllForClassFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressAllForClassFix.java index e39e54fbf800..5be443840641 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressAllForClassFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressAllForClassFix.java @@ -72,8 +72,8 @@ public class SuppressAllForClassFix extends SuppressFix { if (modifierList != null) { final PsiAnnotation annotation = modifierList.findAnnotation(SuppressManagerImpl.SUPPRESS_INSPECTIONS_ANNOTATION_NAME); if (annotation != null) { - annotation.replace(JavaPsiFacade.getInstance(project).getElementFactory().createAnnotationFromText("@" + SuppressManagerImpl.SUPPRESS_INSPECTIONS_ANNOTATION_NAME + "({\"" + - SuppressionUtil.ALL + "\"})", container)); + annotation.replace(JavaPsiFacade.getInstance(project).getElementFactory().createAnnotationFromText("@" + SuppressManagerImpl.SUPPRESS_INSPECTIONS_ANNOTATION_NAME + "(\"" + + SuppressionUtil.ALL + "\")", container)); return; } } diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressFix.java index c8ff3bed488d..67b7963e6297 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressFix.java @@ -177,7 +177,7 @@ public class SuppressFix extends SuppressIntentionAction { } else { return JavaPsiFacade.getInstance(project).getElementFactory() - .createAnnotationFromText("@" + SuppressManager.SUPPRESS_INSPECTIONS_ANNOTATION_NAME + "({\"" + id + "\"})", container); + .createAnnotationFromText("@" + SuppressManager.SUPPRESS_INSPECTIONS_ANNOTATION_NAME + "(\"" + id + "\")", container); } return null; } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/suppress15Inspections/after1.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/suppress15Inspections/after1.java index f158d7ee5406..19c210976544 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/suppress15Inspections/after1.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/suppress15Inspections/after1.java @@ -1,5 +1,5 @@ // "Suppress all inspections for class" "true" -@SuppressWarnings({"ALL"}) +@SuppressWarnings("ALL") public class Test { public void run(int i) { } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/suppress15Inspections/after2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/suppress15Inspections/after2.java index d67b48714a73..f2a1850d8a71 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/suppress15Inspections/after2.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/suppress15Inspections/after2.java @@ -1,6 +1,6 @@ // "Suppress for statement" "true" public class Test { public void run() { - @SuppressWarnings({"UnusedDeclaration"}) int i; + @SuppressWarnings("UnusedDeclaration") int i; } } \ No newline at end of file