mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Java inspection: Rename the inspection to a noun-based name, update documentation (IDEA-157727)
This commit is contained in:
+3
-3
@@ -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"/>
|
||||
<localInspection groupPath="Java" language="JAVA" shortName="ExpandToNormalAnnotation" bundle="com.siyeh.InspectionGadgetsBundle"
|
||||
key="expand.to.normal.annotation.name" groupBundle="messages.InspectionsBundle"
|
||||
<localInspection groupPath="Java" language="JAVA" shortName="SingleElementAnnotation" bundle="com.siyeh.InspectionGadgetsBundle"
|
||||
key="single.element.annotation.name" groupBundle="messages.InspectionsBundle"
|
||||
groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION"
|
||||
implementationClass="com.siyeh.ig.annotation.ExpandToNormalAnnotationInspection"/>
|
||||
implementationClass="com.siyeh.ig.annotation.SingleElementAnnotationInspection"/>
|
||||
<localInspection groupPath="Java" language="JAVA" shortName="AddArrayCreationExpression" bundle="com.siyeh.InspectionGadgetsBundle"
|
||||
key="add.array.creation.expression.name" groupBundle="messages.InspectionsBundle"
|
||||
groupKey="group.names.code.style.issues" enabledByDefault="true" level="INFORMATION"
|
||||
|
||||
+3
-3
@@ -2182,9 +2182,9 @@ single.statement.in.block.name=Code block contains single statement
|
||||
single.statement.in.block.descriptor=''{0}'' contains single statement
|
||||
single.statement.in.block.quickfix=Remove braces from ''{0}'' statement
|
||||
single.statement.in.block.family.quickfix=Remove braces from statement
|
||||
expand.to.normal.annotation.name=Single-element annotation
|
||||
expand.to.normal.annotation.quickfix=Add 'value='
|
||||
expand.to.normal.annotation.family.quickfix=Expand annotation to normal form
|
||||
single.element.annotation.name=Single-element annotation
|
||||
single.element.annotation.quickfix=Add 'value='
|
||||
single.element.annotation.family.quickfix=Expand annotation to normal form
|
||||
add.array.creation.expression.name=Add array creation expression
|
||||
add.array.creation.expression.descriptor=Add ''new {0}''
|
||||
malformed.set.up.tear.down.display.name=Malformed 'setUp()' or 'tearDown()'
|
||||
|
||||
+4
-5
@@ -28,15 +28,14 @@ import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
public class ExpandToNormalAnnotationInspection extends BaseInspection {
|
||||
public class SingleElementAnnotationInspection extends BaseInspection {
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return InspectionGadgetsBundle.message("expand.to.normal.annotation.name");
|
||||
return InspectionGadgetsBundle.message("single.element.annotation.name");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -61,14 +60,14 @@ public class ExpandToNormalAnnotationInspection extends BaseInspection {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return InspectionGadgetsBundle.message("expand.to.normal.annotation.quickfix");
|
||||
return InspectionGadgetsBundle.message("single.element.annotation.quickfix");
|
||||
}
|
||||
|
||||
@Nls
|
||||
@NotNull
|
||||
@Override
|
||||
public String getFamilyName() {
|
||||
return InspectionGadgetsBundle.message("expand.to.normal.annotation.family.quickfix");
|
||||
return InspectionGadgetsBundle.message("single.element.annotation.family.quickfix");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,6 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
This inspection reports annotations in the <i>single-element</i> form, like @Retention(RUNTIME).
|
||||
<p>The quick fix for this inspection converts annotation to the <i>normal</i> form (with attribute name), e.g. @Retention(value=RUNTIME).
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<body>
|
||||
This inspection reports annotations in the 'single element' shorthand form, like <code>@Retention(RUNTIME)</code>.
|
||||
<p>The quick fix for this inspection converts annotation to the 'normal' form (with attribute name),
|
||||
e.g. <code>@Retention(value=RUNTIME)</code>.
|
||||
</body>
|
||||
</html>
|
||||
+4
-4
@@ -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";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user