mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make IG test light and test new option
This commit is contained in:
+11
-1
@@ -8,7 +8,7 @@ public class CloneDeclaresCloneNonSupportedException implements Cloneable
|
||||
|
||||
}
|
||||
|
||||
public Object clone()
|
||||
protected Object <warning descr="'clone()' does not declare 'CloneNotSupportedException'">clone</warning>()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -34,3 +34,13 @@ class Child extends CloneDeclaresCloneNonSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
}
|
||||
class NoWarnOnPublic implements Cloneable {
|
||||
|
||||
public Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>CloneDeclaresCloneNonSupportedException.java</file>
|
||||
<line>11</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'clone()' does not declare 'CloneNotSupportedException'</problem_class>
|
||||
<description><code>clone()</code> does not declare 'CloneNotSupportedException'</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+12
-4
@@ -1,10 +1,18 @@
|
||||
package com.siyeh.ig.cloneable;
|
||||
|
||||
import com.siyeh.ig.IGInspectionTestCase;
|
||||
import com.intellij.codeInspection.InspectionProfileEntry;
|
||||
import com.siyeh.ig.LightInspectionTestCase;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class CloneDeclaresCloneNotSupportedInspectionTest extends IGInspectionTestCase {
|
||||
public class CloneDeclaresCloneNotSupportedInspectionTest extends LightInspectionTestCase {
|
||||
|
||||
public void test() throws Exception {
|
||||
doTest("com/siyeh/igtest/cloneable/clone_declares_clone_not_supported", new CloneDeclaresCloneNotSupportedInspection());
|
||||
public void testCloneDeclaresCloneNonSupportedException() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected InspectionProfileEntry getInspection() {
|
||||
return new CloneDeclaresCloneNotSupportedInspection();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user