mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
testdata for (IDEA-108664)
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
class X {
|
||||
void foo(java.util.List l) {
|
||||
for (Object o : l) {
|
||||
<selection>if (o == null) continue;
|
||||
Object x = bar(o);</selection>
|
||||
System.out.println(x);
|
||||
}
|
||||
}
|
||||
|
||||
private String bar(Object o) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class X {
|
||||
void foo(java.util.List l) {
|
||||
for (Object o : l) {
|
||||
Object x = newMethod(o);
|
||||
if (x == null) continue;
|
||||
System.out.println(x);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Object newMethod(Object o) {
|
||||
if (o == null) return null;
|
||||
Object x = bar(o);
|
||||
return x;
|
||||
}
|
||||
|
||||
private String bar(Object o) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -619,6 +619,10 @@ public class ExtractMethodTest extends LightCodeInsightTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInferredNotNullInReturnStatement() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTestDisabledParam() throws PrepareFailedException {
|
||||
final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
|
||||
settings.ELSE_ON_NEW_LINE = true;
|
||||
|
||||
Reference in New Issue
Block a user