[java-dfa] Type annotations for stream collectors; now, special processing of non-null collections is unnecessary

Part of IDEA-231901 Support TYPE_USE in external annotations

GitOrigin-RevId: 34e116eddf5dbc90468311e5fd2d0c30e600fc1a
This commit is contained in:
Tagir Valeev
2024-09-18 13:49:50 +02:00
committed by intellij-monorepo-bot
parent b50767f679
commit ffd5d01482
2 changed files with 46 additions and 12 deletions

View File

@@ -201,11 +201,8 @@ public class StreamChainInliner implements CallInliner {
}
static class UnknownTerminalStep extends Step {
private final boolean myNotNullResult;
UnknownTerminalStep(PsiMethodCallExpression call, boolean notNullResult) {
UnknownTerminalStep(PsiMethodCallExpression call) {
super(call, null, null);
myNotNullResult = notNullResult;
}
@Override
@@ -223,12 +220,6 @@ public class StreamChainInliner implements CallInliner {
// Stream variable is on stack
builder.pop().flushFields();
}
@NotNull
@Override
Nullability getNullability() {
return myNotNullResult ? Nullability.NOT_NULL : super.getNullability();
}
}
abstract static class TerminalStep extends Step {
@@ -1037,7 +1028,7 @@ public class StreamChainInliner implements CallInliner {
private static Step createTerminalStep(PsiMethodCallExpression call) {
Step step = TERMINAL_STEP_MAPPER.mapFirst(call);
return step == null ? new UnknownTerminalStep(call, false) : step;
return step == null ? new UnknownTerminalStep(call) : step;
}
private static Step createTerminalFromCollector(PsiMethodCallExpression call) {
@@ -1072,7 +1063,7 @@ public class StreamChainInliner implements CallInliner {
}
}
return new UnknownTerminalStep(call, NOT_NULL_COLLECTORS.test(collectorCall));
return new UnknownTerminalStep(call);
}
@Override