mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
IDEA-172877 Provide a quick-fix on 'Not a statement' error message
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// "Extract side effects" "true"
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class Main {
|
||||
public void test(AtomicInteger i) {
|
||||
i.incrementAndGet();
|
||||
i.incrementAndGet();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Convert to 'if' statement" "true"
|
||||
import java.io.File;
|
||||
|
||||
public class Main {
|
||||
public void test(File f) {
|
||||
if (!f.isDirectory()) {
|
||||
f.mkdirs();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Extract side effect" "true"
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class Main {
|
||||
public void test(AtomicInteger i) {
|
||||
i.incrementAndGet();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Extract side effects" "true"
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class Main {
|
||||
public void test(AtomicInteger i) {
|
||||
i.incrementAndGet() <caret>+ i.incrementAndGet();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Convert to 'if' statement" "true"
|
||||
import java.io.File;
|
||||
|
||||
public class Main {
|
||||
public void test(File f) {
|
||||
f.isDirectory() |<caret>| f.mkdirs();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Extract side effect" "true"
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class Main {
|
||||
public void test(AtomicInteger i) {
|
||||
i.incrementAndGet() <caret>+ 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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.intellij.java.codeInsight.daemon.quickFix;
|
||||
|
||||
import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
|
||||
|
||||
public class ExtractSideEffectsTest extends LightQuickFixParameterizedTestCase {
|
||||
public void test() throws Exception { doAllTests(); }
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return "/codeInsight/daemonCodeAnalyzer/quickFix/extractSideEffects";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user