mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
1. add new line before and after code block braces when wrapping user code 2. add example in inspection description 3. remove OptionalToIfInspectionTest#runSingle 4. remove duplicates from operation names list 5. remove unnecessary whitespaces from strings with converted operations 6. support final variables and local variables with implicit type 7. honor operation precedence when merging two if checks during simplification 8. StringUtil#join instead of Collectors#joining 9. remove code after throw during simplification GitOrigin-RevId: cd3273072ad3bdba21aa5b28a6fd13dc325e93ad
18 lines
508 B
Java
18 lines
508 B
Java
// "Fix all 'Optional can be replaced with sequence of if statements' problems in file" "true"
|
|
|
|
import java.util.*;
|
|
|
|
class Test {
|
|
|
|
String exceptionIsThrownIfNull(String in) {
|
|
if (in == null || in.length() <= 2) throw new NoSuchElementException("No value present");
|
|
return in;
|
|
}
|
|
|
|
void ofNullableGetFinalVar(String in) {
|
|
if (in == null) throw new NoSuchElementException("No value present");
|
|
final String out = in;
|
|
Runnable r = () -> java.lang.System.out.println(out);
|
|
}
|
|
|
|
} |