mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
JavaSliceBuilder: avoid decrementing beyond zero
Fixes EA-232342 - assert: JavaSliceBuilder.<init> GitOrigin-RevId: 3f33f778c90199e8b7745d2ac29022d2d4716b06
This commit is contained in:
committed by
intellij-monorepo-bot
parent
15e1ca57c9
commit
7ef1e04f92
@@ -89,14 +89,16 @@ final class JavaSliceBuilder {
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@NotNull JavaSliceBuilder updateNesting(@NotNull Flow anno) {
|
||||
JavaSliceBuilder result = this;
|
||||
if (anno.targetIsContainer() && anno.sourceIsContainer()) {
|
||||
return new JavaSliceBuilder(myParent, mySubstitutor, myIndexNesting, mySyntheticField, myFilter.unwrap().wrap());
|
||||
}
|
||||
if (anno.targetIsContainer()) {
|
||||
result = result.decrementNesting();
|
||||
return decrementNesting();
|
||||
}
|
||||
if (anno.sourceIsContainer()) {
|
||||
result = result.incrementNesting();
|
||||
return incrementNesting();
|
||||
}
|
||||
return result;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
void test(List<String> <flown11>list) {
|
||||
String[] array = <flown1>list.toArray(new String[0]);
|
||||
System.out.println(<caret>array);
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,7 @@ public class SliceBackwardTest extends SliceTestCase {
|
||||
public void testSearchOverriddenMethodsInThisClassHierarchyParamDfa() throws Exception { doTest();}
|
||||
public void testAppend() throws Exception { doTest();}
|
||||
public void testRequireNonNull() throws Exception { doTest();}
|
||||
public void testBackAndForward() throws Exception { doTest();}
|
||||
|
||||
public void testFilterIntRange() throws Exception { doTest(">=0");}
|
||||
public void testFilterIntRangeArray() throws Exception { doTest(">=0");}
|
||||
|
||||
Reference in New Issue
Block a user