make IG test light

This commit is contained in:
Bas Leijdekkers
2015-07-02 17:52:30 +02:00
parent 899954178f
commit ffded1998d
15 changed files with 22 additions and 46 deletions
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
</problems>
@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
</problems>
@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
</problems>
@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
</problems>
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
</problems>
@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
</problems>
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>ElseElse.java</file>
<line>26</line>
<description>Cast &lt;code&gt;(B)o&lt;/code&gt; conflicts with surrounding 'instanceof' check #loc</description>
</problem>
</problems>
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public interface I {}
interface I {}
class A implements I {}
class B implements I {}
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public interface I {}
interface I {}
class A implements I {}
class B implements I {}
@@ -1,4 +1,4 @@
public interface I {}
interface I {}
class A implements I {}
class B implements I {}
@@ -6,7 +6,7 @@ class U {
void foo(Object o) {
boolean b = false;
if (o instanceof I) {
b = o instanceof A && bar((A)a) && !bazz((A)a)
b = o instanceof A && bar((A)o) && !bazz((A)o);
}
}
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public interface I {}
interface I {}
class A implements I {}
class B implements I {}
@@ -23,7 +23,7 @@ class U {
} else {
if (o instanceof A) {
B bb = (B)o;
B bb = <warning descr="Cast '(B)o' conflicts with surrounding 'instanceof' check">(B)o</warning>;
} else {
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,39 +15,43 @@
*/
package com.siyeh.ig.bugs;
import com.siyeh.ig.IGInspectionTestCase;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;
public class CastConflictsWithInstanceofInspectionTest extends IGInspectionTestCase {
public class CastConflictsWithInstanceofInspectionTest extends LightInspectionTestCase {
public void testElseElse() throws Exception {
public void testElseElse() {
doTest();
}
public void testSimple() throws Exception {
public void testSimple() {
doTest();
}
public void testElseElseOrOr() throws Exception {
public void testElseElseOrOr() {
doTest();
}
public void testAndAnd() throws Exception {
public void testAndAnd() {
doTest();
}
public void testPolyadic() throws Exception {
public void testPolyadic() {
doTest();
}
public void testNotOr() throws Exception {
public void testNotOr() {
doTest();
}
public void testOrInstanceofOrInstanceof() throws Exception {
public void testOrInstanceofOrInstanceof() {
doTest();
}
private void doTest() throws Exception {
doTest("com/siyeh/igtest/bugs/castConflictingInstanceof/" + getTestName(true), new CastConflictsWithInstanceofInspection());
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
return new CastConflictsWithInstanceofInspection();
}
}