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
@@ -27,7 +27,7 @@ class SynchronizationOnLocalVariableOrMethodParameter {
|
||||
|
||||
void bar() {
|
||||
final Object lock = new Object();
|
||||
synchronized (lock) {
|
||||
synchronized (<warning descr="Synchronization on local variable 'lock'">lock</warning>) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>SynchronizationOnLocalVariableOrMethodParameter.java</file>
|
||||
<line>30</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Synchronization on local variable or method parameter</problem_class>
|
||||
<description>Synchronization on local variable <code>lock</code> #loc</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+10
-13
@@ -1,21 +1,18 @@
|
||||
package com.siyeh.ig.threading;
|
||||
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import com.siyeh.ig.IGInspectionTestCase;
|
||||
import com.intellij.codeInspection.InspectionProfileEntry;
|
||||
import com.siyeh.ig.LightInspectionTestCase;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class SynchronizationOnLocalVariableOrMethodParameterInspectionTest extends IGInspectionTestCase {
|
||||
public class SynchronizationOnLocalVariableOrMethodParameterInspectionTest extends LightInspectionTestCase {
|
||||
|
||||
@Override
|
||||
protected Sdk getTestProjectSdk() {
|
||||
LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_8);
|
||||
return IdeaTestUtil.getMockJdk17();
|
||||
public void testSynchronizationOnLocalVariableOrMethodParameter() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
doTest("com/siyeh/igtest/threading/synchronization_on_local_variable_or_method_parameter",
|
||||
new SynchronizationOnLocalVariableOrMethodParameterInspection());
|
||||
@Nullable
|
||||
@Override
|
||||
protected InspectionProfileEntry getInspection() {
|
||||
return new SynchronizationOnLocalVariableOrMethodParameterInspection();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user