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:
+1
-1
@@ -7,7 +7,7 @@ public class SwitchStatementWithConfusingDeclaration
|
||||
switch(3)
|
||||
{
|
||||
case 2:
|
||||
int x = 0;
|
||||
int <warning descr="Local variable 'x' declared in one 'switch' branch and used in another">x</warning> = 0;
|
||||
break;
|
||||
case 3:
|
||||
x = 3;
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>SwitchStatementWithConfusingDeclaration.java</file>
|
||||
<line>10</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Local variable used and declared in different 'switch' branches</problem_class>
|
||||
<description>Local variable <code>x</code> declared in one 'switch' branch and used in another #loc</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+27
-5
@@ -1,11 +1,33 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.siyeh.ig.controlflow;
|
||||
|
||||
import com.siyeh.ig.IGInspectionTestCase;
|
||||
import com.intellij.codeInspection.InspectionProfileEntry;
|
||||
import com.siyeh.ig.LightInspectionTestCase;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class SwitchStatementWithConfusingDeclarationInspectionTest extends IGInspectionTestCase {
|
||||
public class SwitchStatementWithConfusingDeclarationInspectionTest extends LightInspectionTestCase {
|
||||
|
||||
public void test() {
|
||||
doTest("com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration",
|
||||
new SwitchStatementWithConfusingDeclarationInspection());
|
||||
public void testSwitchStatementWithConfusingDeclaration() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected InspectionProfileEntry getInspection() {
|
||||
return new SwitchStatementWithConfusingDeclarationInspection();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user