mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
remove redundant else: check all then clauses (IDEA-58136)
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// "Remove Redundant 'else'" "true"
|
||||
class a {
|
||||
void foo() {
|
||||
int a = 0;
|
||||
int b = 0;
|
||||
if (a != b) {
|
||||
return;
|
||||
}
|
||||
a = b;
|
||||
a++;
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Remove Redundant 'else'" "true"
|
||||
class a {
|
||||
void foo() {
|
||||
int a = 0;
|
||||
int b = 0;
|
||||
if (a != b) {
|
||||
return;
|
||||
} e<caret>lse {
|
||||
a = b;
|
||||
}
|
||||
a++;
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// "Remove Redundant 'else'" "false"
|
||||
class a {
|
||||
void foo() {
|
||||
int a = 0;
|
||||
int b = 0;
|
||||
if (a != b) {
|
||||
a = 10;
|
||||
} else if (a + 1 == b) {
|
||||
return;
|
||||
}
|
||||
e<caret>lse {
|
||||
a = b;
|
||||
}
|
||||
a++;
|
||||
}
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2000-2010 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.codeInsight.daemon.quickFix;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: Aug 30, 2010
|
||||
*/
|
||||
public class RemoveRedundantElseActionTest extends LightQuickFixTestCase {
|
||||
|
||||
public void test() throws Exception { doAllTests(); }
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/codeInsight/daemonCodeAnalyzer/quickFix/removeRedundantElse";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user