IDEA-80097 "Redundant suppression" inspection ability to ignore "ALL"

This commit is contained in:
Anna Kozlova
2012-01-25 15:26:12 +04:00
parent 608afc659e
commit 09ac72236b
6 changed files with 200 additions and 0 deletions
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>X.java</file>
<line>4</line>
<problem_class>Redundant suppression</problem_class>
<description>Redundant suppression</description>
<entry_point TYPE="method" FQNAME="x.S void f()" />
</problem>
<problem>
<file>X.java</file>
<line>42</line>
<problem_class>Redundant suppression</problem_class>
<description>Redundant suppression</description>
<entry_point TYPE="method" FQNAME="x.S void j()" />
</problem>
<problem>
<file>X.java</file>
<line>53</line>
<problem_class>Redundant suppression</problem_class>
<description>Redundant suppression</description>
<entry_point TYPE="field" FQNAME="x.S$3ss s" />
</problem>
<problem>
<file>X.java</file>
<line>19</line>
<problem_class>Redundant suppression</problem_class>
<description>Redundant suppression</description>
<entry_point TYPE="method" FQNAME="x.S void h()" />
</problem>
<problem>
<file>X.java</file>
<line>30</line>
<problem_class>Redundant suppression</problem_class>
<description>Redundant suppression</description>
<entry_point TYPE="class" FQNAME="x.S$1ss" />
</problem>
<problem>
<file>X.java</file>
<line>11</line>
<problem_class>Redundant suppression</problem_class>
<description>Redundant suppression</description>
<entry_point TYPE="method" FQNAME="x.S void g()" />
</problem>
<problem>
<file>X.java</file>
<line>67</line>
<problem_class>Redundant suppression</problem_class>
<description>Redundant suppression</description>
<entry_point TYPE="method" FQNAME="x.S void foo1()" />
</problem>
</problems>
@@ -0,0 +1,69 @@
package x;
class S {
public void f() {
//noinspection HardCodedStringLiteral
String s=null;
//noinspection HardCodedStringLiteral
String s2="sssssss";
}
@SuppressWarnings({"HardCodedStringLiteral"})
void g() {
String s = null;
}
@SuppressWarnings({"HardCodedStringLiteral"})
void g2() {
String s = "sssssss";
}
void h() {
@SuppressWarnings({"HardCodedStringLiteral"})
String s = null;
}
void h2() {
@SuppressWarnings({"HardCodedStringLiteral"})
String s = "sssssss";
}
void i() {
@SuppressWarnings({"HardCodedStringLiteral"})
class ss {
String s = null;
}
}
void i2() {
@SuppressWarnings({"HardCodedStringLiteral"})
class ss {
String s = "sssssss";
}
}
/** @noinspection HardCodedStringLiteral */
void j() {
String s = null;
}
/** @noinspection HardCodedStringLiteral */
void j2() {
String s = "sssssss";
}
void k() {
class ss {
/** @noinspection HardCodedStringLiteral */
String s = null;
}
}
void k2() {
class ss {
/** @noinspection HardCodedStringLiteral */
String s = "sssssss";
}
}
@SuppressWarnings({"EmptyMethod"})
void foo() {}
@SuppressWarnings({"EmptyMethod"})
void foo1() {String f;}
}
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
</problems>
@@ -0,0 +1,8 @@
package x;
public class S {
@SuppressWarnings("ALL")
public static void main(String[] args) {
System.out.println(args[0]);
}
}