LambdaGenerationUtil: disable if expression is accessed for writing

Fixes IDEA-165482 Optional.isPresent suggests to replace the code which assigns the variable defined outside
This commit is contained in:
Tagir Valeev
2016-12-15 11:51:58 +07:00
parent d8329c5638
commit 3741495801
2 changed files with 22 additions and 5 deletions
@@ -0,0 +1,13 @@
// "Replace Optional.isPresent() condition with functional style expression" "false"
import java.util.Optional;
public class Main {
void assignVariable(Optional<Object> opt) {
String s;
if(opt.isPre<caret>sent()) {
s = opt.get().toString();
}
String s2 = s;
}
}