Files
openide/java/java-tests/testData/refactoring/inlineMethod/ForContinue.java.after
Tagir Valeev c5efd1ca7a Inline method: automatically convert to "continue"; automatically transform method body to single return when possible
Fixes IDEA-37432 "Inline Method refactoring is not supported when return statement interrupts the execution flow" is wrong
Fixes IDEA-158665 Support Inline Method refactoring when return statement interrupts the execution flow
Fixes IDEA-180007 Inline method with returns should work when inlining point is the only expression in a loop or lambda body
2019-04-16 16:47:28 +07:00

18 lines
457 B
Plaintext

import java.util.*;
class AAA {
private void foo(List<String> list) {
for (String val : list) {
if (val == null) continue;
val = val.trim();
if (val.isEmpty()) continue;
try {
Integer.parseInt(val);
} catch (NumberFormatException e) {
continue;
}
throw new IllegalArgumentException("Should not be a number!");
}
}
}