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:
+4
-4
@@ -6,9 +6,9 @@ class SynchronizedOnLiteralObject {
|
||||
private Character c = 'a';
|
||||
|
||||
void foo() {
|
||||
synchronized (myInteger) {}
|
||||
synchronized ("asdf") {}
|
||||
synchronized ((Boolean) true) {}
|
||||
synchronized (c) {}
|
||||
synchronized (<warning descr="Synchronization on Integer 'myInteger' which is initialized by a literal">myInteger</warning>) {}
|
||||
synchronized (<warning descr="Synchronization on String literal '\"asdf\"'">"asdf"</warning>) {}
|
||||
synchronized (<warning descr="Synchronization on Boolean literal '(Boolean) true'">(Boolean) true</warning>) {}
|
||||
synchronized (<warning descr="Synchronization on Character 'c' which is initialized by a literal">c</warning>) {}
|
||||
}
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>SynchronizedOnLiteralObject.java</file>
|
||||
<line>9</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Synchronization on an object initialized with a literal</problem_class>
|
||||
<description>Synchronization on Integer <code>myInteger</code> which is initialized by a literal #loc</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>SynchronizedOnLiteralObject.java</file>
|
||||
<line>10</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Synchronization on an object initialized with a literal</problem_class>
|
||||
<description>Synchronization on String <code>"asdf"</code> which is initialized by a literal #loc</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>SynchronizedOnLiteralObject.java</file>
|
||||
<line>11</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Synchronization on an object initialized with a literal</problem_class>
|
||||
<description>Synchronization on Boolean <code>(Boolean) true</code> which is initialized by a literal #loc</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>SynchronizedOnLiteralObject.java</file>
|
||||
<line>12</line>
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Synchronization on an object initialized with a literal</problem_class>
|
||||
<description>Synchronization on Character <code>c</code> which is initialized by a literal #loc</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+30
-4
@@ -1,10 +1,36 @@
|
||||
/*
|
||||
* 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.threading;
|
||||
|
||||
import com.siyeh.ig.IGInspectionTestCase;
|
||||
import com.intellij.codeInspection.InspectionProfileEntry;
|
||||
import com.siyeh.ig.LightInspectionTestCase;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class SynchronizedOnLiteralObjectInspectionTest extends IGInspectionTestCase {
|
||||
/**
|
||||
* @author Bas
|
||||
*/
|
||||
public class SynchronizedOnLiteralObjectInspectionTest extends LightInspectionTestCase {
|
||||
|
||||
public void test() throws Exception {
|
||||
doTest("com/siyeh/igtest/threading/synchronized_on_literal_object", new SynchronizedOnLiteralObjectInspection());
|
||||
public void testSynchronizedOnLiteralObject() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected InspectionProfileEntry getInspection() {
|
||||
return new SynchronizedOnLiteralObjectInspection();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user