summaryrefslogtreecommitdiff
path: root/plugins/InspectionGadgets/test/com/siyeh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/InspectionGadgets/test/com/siyeh')
-rw-r--r--plugins/InspectionGadgets/test/com/siyeh/igfixes/junit/useOfObsoleteAssert/singleStaticImport.after.java (renamed from plugins/InspectionGadgets/test/com/siyeh/igfixes/junit/useOfObsoleteAssert/singleStaticIport.after.java)0
-rw-r--r--plugins/InspectionGadgets/test/com/siyeh/igfixes/performance/replace_with_isempty/NullCheckAlreadyPresent.after.java12
-rw-r--r--plugins/InspectionGadgets/test/com/siyeh/igfixes/performance/replace_with_isempty/NullCheckAlreadyPresent.java12
-rw-r--r--plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java1
-rw-r--r--plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/expected.xml84
5 files changed, 25 insertions, 84 deletions
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/junit/useOfObsoleteAssert/singleStaticIport.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/junit/useOfObsoleteAssert/singleStaticImport.after.java
index f026afe3785e..f026afe3785e 100644
--- a/plugins/InspectionGadgets/test/com/siyeh/igfixes/junit/useOfObsoleteAssert/singleStaticIport.after.java
+++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/junit/useOfObsoleteAssert/singleStaticImport.after.java
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/performance/replace_with_isempty/NullCheckAlreadyPresent.after.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/performance/replace_with_isempty/NullCheckAlreadyPresent.after.java
new file mode 100644
index 000000000000..7277bd021670
--- /dev/null
+++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/performance/replace_with_isempty/NullCheckAlreadyPresent.after.java
@@ -0,0 +1,12 @@
+package com.siyeh.igfixes.performance.replace_with_isempty;
+
+public class NullCheckAlreadyPresent {
+
+ String[] splitProperties = {"1","2"};
+
+ public void someAction() {
+ if (splitProperties[1] != null && splitProperties[1].isEmpty()) {
+ System.out.println("");
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igfixes/performance/replace_with_isempty/NullCheckAlreadyPresent.java b/plugins/InspectionGadgets/test/com/siyeh/igfixes/performance/replace_with_isempty/NullCheckAlreadyPresent.java
new file mode 100644
index 000000000000..e91b650758e2
--- /dev/null
+++ b/plugins/InspectionGadgets/test/com/siyeh/igfixes/performance/replace_with_isempty/NullCheckAlreadyPresent.java
@@ -0,0 +1,12 @@
+package com.siyeh.igfixes.performance.replace_with_isempty;
+
+public class NullCheckAlreadyPresent {
+
+ String[] splitProperties = {"1","2"};
+
+ public void someAction() {
+ if (splitProperties[1] != null && "".<caret>equals(splitProperties[1])) {
+ System.out.println("");
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java
index d7577b1c9c79..019805adcf17 100644
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/PointlessArithmeticExpression.java
@@ -123,4 +123,5 @@ class Expanded {{
System.out.println(u * 1);
long g = 8L / 8L;
long h = 9L * 0L;
+ int a = 8 * 0 * 8 * ; // don't warn
}} \ No newline at end of file
diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/expected.xml
index 58e0898bdcdd..f6af12237ea0 100644
--- a/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/expected.xml
+++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/numeric/pointless_arithmetic_expression/expected.xml
@@ -38,90 +38,6 @@
<problem>
<file>PointlessArithmeticExpression.java</file>
- <line>30</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;k&lt;=Integer.MAX_VALUE&lt;/code&gt; can be replaced with 'true' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>34</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;k&gt;=Integer.MIN_VALUE&lt;/code&gt; can be replaced with 'true' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>38</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;k&gt;Integer.MAX_VALUE&lt;/code&gt; can be replaced with 'false' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>42</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;k&lt;Integer.MIN_VALUE&lt;/code&gt; can be replaced with 'false' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>46</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;Integer.MAX_VALUE &gt;= k&lt;/code&gt; can be replaced with 'true' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>50</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;Integer.MIN_VALUE &lt;= k&lt;/code&gt; can be replaced with 'true' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>54</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;Integer.MAX_VALUE &lt; k&lt;/code&gt; can be replaced with 'false' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>58</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;Integer.MIN_VALUE &gt; k&lt;/code&gt; can be replaced with 'false' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>70</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;i &gt; Integer.MAX_VALUE&lt;/code&gt; can be replaced with 'false' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>76</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;i &lt;= Integer.MAX_VALUE&lt;/code&gt; can be replaced with 'true' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>80</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;i &gt;= Integer.MIN_VALUE&lt;/code&gt; can be replaced with 'true' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
- <line>83</line>
- <problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
- <description>&lt;code&gt;i &lt; Integer.MIN_VALUE&lt;/code&gt; can be replaced with 'false' #loc</description>
- </problem>
-
- <problem>
- <file>PointlessArithmeticExpression.java</file>
<line>93</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Pointless arithmetic expression</problem_class>
<description>&lt;code&gt;i / i&lt;/code&gt; can be replaced with '1' #loc</description>