mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-28 06:51:01 +07:00
IDEA-360860 fixed * split tests into individual methods, to make debugging easier * add javadoc for VariableAccessUtils#isVariableTypeChangeSafeForReference (cherry picked from commit f6b3468079959f7adec737e0b8ec3ad1d97e7ad2) IJ-MR-150176 GitOrigin-RevId: 4b430e49819c7cba1e08ecee47b881f05be570d4
13 lines
353 B
Java
13 lines
353 B
Java
// "Replace Optional presence condition with functional style expression" "GENERIC_ERROR_OR_WARNING"
|
|
|
|
import java.util.*;
|
|
|
|
public class Main {
|
|
public void testOptional(Optional<String> str) {
|
|
if (str == null) str = Optional.empty();
|
|
str.ifPresent(obj -> use(obj + ":" + obj));
|
|
}
|
|
|
|
void use(String obj) { System.out.println("String"); }
|
|
}
|