make IG test light

This commit is contained in:
Bas Leijdekkers
2017-11-24 11:31:02 +01:00
parent 96181f3b41
commit 88753e7fad
3 changed files with 23 additions and 59 deletions
@@ -7,16 +7,16 @@ import java.util.concurrent.Callable;
@interface Anno {
Class method() default List.class;
<warning descr="Raw use of parameterized class 'Class'">Class</warning> method() default List.class;
Class<? extends List> method2() default List.class;
}
class RawUseOfParameterizedType {
void array() {
final ArrayList[] array =
final <warning descr="Raw use of parameterized class 'ArrayList'">ArrayList</warning>[] array =
new ArrayList[10];
}
void anonymous() {
new Callable() {
new <warning descr="Raw use of parameterized class 'Callable'">Callable</warning>() {
@Override
public Object call() throws Exception {
return null;
@@ -29,12 +29,12 @@ class RawUseOfParameterizedType {
}
}
interface X {
List foo(Map map);
<warning descr="Raw use of parameterized class 'List'">List</warning> foo(<warning descr="Raw use of parameterized class 'Map'">Map</warning> map);
}
class Y implements X {
@Override
public List foo(Map map) {
public <warning descr="Raw use of parameterized class 'List'">List</warning> foo(Map map) {
return null;
}
@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>RawUseOfParameterizedType.java</file>
<line>10</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Raw use of parameterized class</problem_class>
<description>Raw use of parameterized class &lt;code&gt;Class&lt;/code&gt; #loc</description>
</problem>
<problem>
<file>RawUseOfParameterizedType.java</file>
<line>15</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Raw use of parameterized class</problem_class>
<description>Raw use of parameterized class &lt;code&gt;ArrayList&lt;/code&gt; #loc</description>
</problem>
<problem>
<file>RawUseOfParameterizedType.java</file>
<line>19</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Raw use of parameterized class</problem_class>
<description>Raw use of parameterized class &lt;code&gt;Callable&lt;/code&gt; #loc</description>
</problem>
<problem>
<file>RawUseOfParameterizedType.java</file>
<line>32</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Raw use of parameterized class</problem_class>
<description>Raw use of parameterized class &lt;code&gt;List&lt;/code&gt; #loc</description>
</problem>
<problem>
<file>RawUseOfParameterizedType.java</file>
<line>32</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Raw use of parameterized class</problem_class>
<description>Raw use of parameterized class &lt;code&gt;Map&lt;/code&gt; #loc</description>
</problem>
<problem>
<file>RawUseOfParameterizedType.java</file>
<line>37</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Raw use of parameterized class</problem_class>
<description>Raw use of parameterized class &lt;code&gt;List&lt;/code&gt; #loc</description>
</problem>
</problems>
@@ -1,15 +1,24 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.siyeh.ig.migration;
import com.siyeh.ig.IGInspectionTestCase;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;
public class RawUseOfParameterizedTypeInspectionTest extends IGInspectionTestCase {
public class RawUseOfParameterizedTypeInspectionTest extends LightInspectionTestCase {
public void test() {
final RawUseOfParameterizedTypeInspection tool = new RawUseOfParameterizedTypeInspection();
tool.ignoreObjectConstruction = false;
tool.ignoreUncompilable = true;
tool.ignoreParametersOfOverridingMethods = true;
tool.ignoreTypeCasts = true;
doTest("com/siyeh/igtest/migration/raw_use_of_parameterized_type", tool);
public void testRawUseOfParameterizedType() {
doTest();
}
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
final RawUseOfParameterizedTypeInspection inspection = new RawUseOfParameterizedTypeInspection();
inspection.ignoreObjectConstruction = false;
inspection.ignoreUncompilable = true;
inspection.ignoreParametersOfOverridingMethods = true;
inspection.ignoreTypeCasts = true;
return inspection;
}
}