mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make IG test light
This commit is contained in:
+5
-5
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
-45
@@ -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 <code>Class</code> #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 <code>ArrayList</code> #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 <code>Callable</code> #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 <code>List</code> #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 <code>Map</code> #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 <code>List</code> #loc</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+18
-9
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user