diff --git a/plugins/stream-debugger/test/com/intellij/debugger/streams/exec/ResultMappingTest.java b/plugins/stream-debugger/test/com/intellij/debugger/streams/exec/ResultMappingTest.java index f032cdc37fcb..6771002cffc3 100644 --- a/plugins/stream-debugger/test/com/intellij/debugger/streams/exec/ResultMappingTest.java +++ b/plugins/stream-debugger/test/com/intellij/debugger/streams/exec/ResultMappingTest.java @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.debugger.streams.exec; import com.intellij.debugger.streams.test.TraceExecutionTestCase; @@ -15,6 +15,10 @@ public class ResultMappingTest extends TraceExecutionTestCase { doTest(false); } + public void testCollectorToListMapping() { + doTest(false); + } + public void testToListMapping() { doTest(false); } diff --git a/plugins/stream-debugger/test/com/intellij/debugger/streams/exec/SpecialCasesTest.java b/plugins/stream-debugger/test/com/intellij/debugger/streams/exec/SpecialCasesTest.java index 6e27acca6717..125da736d4c1 100644 --- a/plugins/stream-debugger/test/com/intellij/debugger/streams/exec/SpecialCasesTest.java +++ b/plugins/stream-debugger/test/com/intellij/debugger/streams/exec/SpecialCasesTest.java @@ -39,8 +39,4 @@ public class SpecialCasesTest extends TraceExecutionTestCase { public void testToCollection() { doTest(false); } - - public void testToList() { - doTest(false); - } } diff --git a/plugins/stream-debugger/testData/debug/outs/collectorToListMapping.out b/plugins/stream-debugger/testData/debug/outs/collectorToListMapping.out new file mode 100644 index 000000000000..4a001bf1bf57 --- /dev/null +++ b/plugins/stream-debugger/testData/debug/outs/collectorToListMapping.out @@ -0,0 +1,21 @@ +LineBreakpoint created at CollectorToListMapping.java:8 +!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!RT_JAR! CollectorToListMapping +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +CollectorToListMapping.java:8 +Stream.of(new Object(), new Object(), new Object()) +.collect(Collectors.toList()) +collect + before: 1,2,3 + after: 4,5,6 +mappings for collect + direct: + 1 -> 4 + 2 -> 5 + 3 -> 6 + reverse: + 1 <- 4 + 2 <- 5 + 3 <- 6 +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/plugins/stream-debugger/testData/debug/outs/toList.out b/plugins/stream-debugger/testData/debug/outs/toList.out deleted file mode 100644 index c6a64de49a7d..000000000000 --- a/plugins/stream-debugger/testData/debug/outs/toList.out +++ /dev/null @@ -1,34 +0,0 @@ -LineBreakpoint created at ToList.java:6 -!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!RT_JAR! ToList -Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' -ToList.java:6 -Stream.of(1, 2, 3, 4, 5, 6) -.filter(x -> x < 3) -.toList() -filter - before: 1,3,5,6,7,8 - after: 2,4 -toList - before: 2,4 - after: 9,10 -mappings for filter - direct: - 1 -> 2 - 3 -> 4 - 5 -> nothing - 6 -> nothing - 7 -> nothing - 8 -> nothing - reverse: - 1 <- 2 - 3 <- 4 -mappings for toList - direct: - 2 -> 9 - 4 -> 10 - reverse: - 2 <- 9 - 4 <- 10 -Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' - -Process finished with exit code 0 diff --git a/plugins/stream-debugger/testData/debug/outs/toListMapping.out b/plugins/stream-debugger/testData/debug/outs/toListMapping.out index 26745ec23b9b..ba7ee4e82d90 100644 --- a/plugins/stream-debugger/testData/debug/outs/toListMapping.out +++ b/plugins/stream-debugger/testData/debug/outs/toListMapping.out @@ -3,11 +3,11 @@ LineBreakpoint created at ToListMapping.java:8 Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' ToListMapping.java:8 Stream.of(new Object(), new Object(), new Object()) -.collect(Collectors.toList()) -collect +.toList() +toList before: 1,2,3 after: 4,5,6 -mappings for collect +mappings for toList direct: 1 -> 4 2 -> 5 diff --git a/plugins/stream-debugger/testData/debug/src/CollectorToListMapping.java b/plugins/stream-debugger/testData/debug/src/CollectorToListMapping.java new file mode 100644 index 000000000000..5840234a3a72 --- /dev/null +++ b/plugins/stream-debugger/testData/debug/src/CollectorToListMapping.java @@ -0,0 +1,10 @@ +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +public class CollectorToListMapping { + public static void main(String[] args) { + // Breakpoint! + final List objects = Stream.of(new Object(), new Object(), new Object()).collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/plugins/stream-debugger/testData/debug/src/ToList.java b/plugins/stream-debugger/testData/debug/src/ToList.java deleted file mode 100644 index 35881756fe0b..000000000000 --- a/plugins/stream-debugger/testData/debug/src/ToList.java +++ /dev/null @@ -1,8 +0,0 @@ -import java.util.stream.Stream; - -public class ToList { - public static void main(String[] args) { - // Breakpoint! - Stream.of(1, 2, 3, 4, 5, 6).filter(x -> x < 3).toList(); - } -} diff --git a/plugins/stream-debugger/testData/debug/src/ToListMapping.java b/plugins/stream-debugger/testData/debug/src/ToListMapping.java index eb78b9bf02ae..81d8e7fb97a8 100644 --- a/plugins/stream-debugger/testData/debug/src/ToListMapping.java +++ b/plugins/stream-debugger/testData/debug/src/ToListMapping.java @@ -5,6 +5,6 @@ import java.util.stream.Stream; public class ToListMapping { public static void main(String[] args) { // Breakpoint! - final List objects = Stream.of(new Object(), new Object(), new Object()).collect(Collectors.toList()); + final List objects = Stream.of(new Object(), new Object(), new Object()).toList(); } } \ No newline at end of file