diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml index d20aada1dcda..69c63e843b0e 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/META-INF/InspectionGadgets.xml @@ -2547,10 +2547,10 @@ key="split.multi.catch.name" groupBundle="messages.InspectionsBundle" groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION" implementationClass="com.siyeh.ig.exceptions.SplitMultiCatchInspection"/> - + implementationClass="com.siyeh.ig.annotation.SingleElementAnnotationInspection"/> - -This inspection reports annotations in the single-element form, like @Retention(RUNTIME). -

The quick fix for this inspection converts annotation to the normal form (with attribute name), e.g. @Retention(value=RUNTIME). - - diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/SingleElementAnnotation.html b/plugins/InspectionGadgets/src/inspectionDescriptions/SingleElementAnnotation.html new file mode 100644 index 000000000000..a286ebcfd796 --- /dev/null +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/SingleElementAnnotation.html @@ -0,0 +1,7 @@ + + +This inspection reports annotations in the 'single element' shorthand form, like @Retention(RUNTIME). +

The quick fix for this inspection converts annotation to the 'normal' form (with attribute name), +e.g. @Retention(value=RUNTIME). + + diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/style/ExpandToNormalAnnotationInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/style/SingleElementAnnotationInspectionTest.java similarity index 82% rename from plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/style/ExpandToNormalAnnotationInspectionTest.java rename to plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/style/SingleElementAnnotationInspectionTest.java index b3b89251a521..a4e8f313cf6d 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/style/ExpandToNormalAnnotationInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/style/SingleElementAnnotationInspectionTest.java @@ -17,9 +17,9 @@ package com.siyeh.ig.fixes.style; import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.IGQuickFixesTestCase; -import com.siyeh.ig.annotation.ExpandToNormalAnnotationInspection; +import com.siyeh.ig.annotation.SingleElementAnnotationInspection; -public class ExpandToNormalAnnotationInspectionTest extends IGQuickFixesTestCase { +public class SingleElementAnnotationInspectionTest extends IGQuickFixesTestCase { public void testOneAttr() { doTest(); @@ -64,8 +64,8 @@ public class ExpandToNormalAnnotationInspectionTest extends IGQuickFixesTestCase @Override protected void setUp() throws Exception { super.setUp(); - myFixture.enableInspections(new ExpandToNormalAnnotationInspection()); - myDefaultHint = InspectionGadgetsBundle.message("expand.to.normal.annotation.quickfix"); + myFixture.enableInspections(new SingleElementAnnotationInspection()); + myDefaultHint = InspectionGadgetsBundle.message("single.element.annotation.quickfix"); myRelativePath = "style/expand_annotation"; } }