mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CFG: Missing boxing added (EA-125425 - ISE: DfaMemoryStateImpl.addToMap)
This commit is contained in:
@@ -726,6 +726,7 @@ public class CFGBuilder {
|
||||
push(factory.getConstFactory().getSentinel());
|
||||
for (PsiExpression expression : expressions) {
|
||||
pushExpression(expression);
|
||||
boxUnbox(expression, targetVariable.getVariableType());
|
||||
}
|
||||
// Revert order
|
||||
add(new SpliceInstruction(expressions.length, IntStreamEx.ofIndices(expressions).toArray()));
|
||||
|
||||
+3
-1
@@ -712,8 +712,10 @@ public class StreamChainInliner implements CallInliner {
|
||||
}
|
||||
if (single) {
|
||||
// exactly single element
|
||||
PsiExpression arg = sourceCall.getArgumentList().getExpressions()[0];
|
||||
builder
|
||||
.pushExpression(sourceCall.getArgumentList().getExpressions()[0])
|
||||
.pushExpression(arg)
|
||||
.boxUnbox(arg, inType)
|
||||
.chain(firstStep::before)
|
||||
.chain(firstStep::iteration);
|
||||
return;
|
||||
|
||||
@@ -238,4 +238,16 @@ public class StreamInlining {
|
||||
void testToArray(List<String> list) {
|
||||
list.stream().toArray(size -> <warning descr="Function may return null, but it's not allowed here">null</warning>);
|
||||
}
|
||||
|
||||
Object testBoxingExplicit() {
|
||||
return String.join("\n",
|
||||
Stream.of(12, 22)
|
||||
.map(Object::toString)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
public static void testBoxingExplicit2() {
|
||||
double s = Stream.of(1).mapToDouble(x -> x * x).sum();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user