diff --git a/build.gradle b/build.gradle index de1b9aa..4cc9d87 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ apply plugin: 'java' apply plugin: "kotlin" group 'com.intellij.debugger.stream' -version '0.0.8' +version '0.0.9' intellij { type = 'IC' diff --git a/src/main/java/com/intellij/debugger/streams/resolve/IdentityResolver.java b/src/main/java/com/intellij/debugger/streams/resolve/IdentityResolver.java index 2ad5643..5f88e95 100644 --- a/src/main/java/com/intellij/debugger/streams/resolve/IdentityResolver.java +++ b/src/main/java/com/intellij/debugger/streams/resolve/IdentityResolver.java @@ -17,7 +17,8 @@ import com.intellij.debugger.streams.trace.TraceElement; import com.intellij.debugger.streams.trace.TraceInfo; -import com.sun.jdi.Value; +import com.intellij.openapi.diagnostic.Logger; +import com.sun.jdi.*; import one.util.streamex.StreamEx; import org.jetbrains.annotations.NotNull; @@ -30,6 +31,8 @@ * @author Vitaliy.Bibaev */ public class IdentityResolver implements ValuesOrderResolver { + private static final Logger LOG = Logger.getInstance(IdentityResolver.class); + @NotNull @Override public Result resolve(@NotNull TraceInfo info) { @@ -39,15 +42,14 @@ public Result resolve(@NotNull TraceInfo info) { final Map> direct = new HashMap<>(); final Map> reverse = new HashMap<>(); - final Map> grouped = new HashMap<>( - StreamEx.of(after.keySet()) - .sorted() - .map(after::get) - .groupingBy(TraceElement::getValue) - ); + final Map> grouped = StreamEx + .of(after.keySet()) + .sorted() + .map(after::get) + .groupingBy(IdentityResolver::extractKey); for (final TraceElement element : before.values()) { - final Value value = element.getValue(); + final Object value = extractKey(element); final List elements = grouped.get(value); final TraceElement afterItem = elements.get(0); @@ -60,4 +62,19 @@ public Result resolve(@NotNull TraceInfo info) { return Result.of(direct, reverse); } + + private static Object extractKey(@NotNull TraceElement element) { + final Value value = element.getValue(); + if (!(value instanceof PrimitiveValue)) return value; + if (value instanceof IntegerValue) return ((IntegerValue)value).value(); + if (value instanceof DoubleValue) return ((DoubleValue)value).value(); + if (value instanceof LongValue) return ((LongValue)value).value(); + if (value instanceof BooleanValue) return ((BooleanValue)value).value(); + if (value instanceof ByteValue) return ((ByteValue)value).value(); + if (value instanceof CharValue) return ((CharValue)value).value(); + if (value instanceof FloatValue) return ((FloatValue)value).value(); + + LOG.error("unknown primitive value: " + value.type().name()); + return null; + } } diff --git a/src/main/java/com/intellij/debugger/streams/trace/impl/TraceExpressionBuilderImpl.java b/src/main/java/com/intellij/debugger/streams/trace/impl/TraceExpressionBuilderImpl.java index f3f642c..69ed41b 100644 --- a/src/main/java/com/intellij/debugger/streams/trace/impl/TraceExpressionBuilderImpl.java +++ b/src/main/java/com/intellij/debugger/streams/trace/impl/TraceExpressionBuilderImpl.java @@ -150,12 +150,13 @@ private static String buildDeclarations(@NotNull StreamCallTraceHandler producer @NotNull private static String buildStreamExpression(@NotNull StreamChain chain) { - if (chain.getTerminationCall().isVoid()) { - final String resultInitialization = "final Object streamResult = null;" + LINE_SEPARATOR; + final GenericType resultType = chain.getTerminationCall().getResultType(); + if (resultType.equals(GenericType.VOID)) { + final String resultInitialization = "final Object streamResult = new Object[1];" + LINE_SEPARATOR; return resultInitialization + chain.getText() + ";" + LINE_SEPARATOR; } else { - return "final Object streamResult = " + chain.getText() + ";" + LINE_SEPARATOR; + return "final Object streamResult = new " + resultType.getVariableTypeName() + "[] { " + chain.getText() + " };" + LINE_SEPARATOR; } } diff --git a/src/main/java/com/intellij/debugger/streams/trace/impl/TraceResultInterpreterImpl.java b/src/main/java/com/intellij/debugger/streams/trace/impl/TraceResultInterpreterImpl.java index 4400ff4..b724875 100644 --- a/src/main/java/com/intellij/debugger/streams/trace/impl/TraceResultInterpreterImpl.java +++ b/src/main/java/com/intellij/debugger/streams/trace/impl/TraceResultInterpreterImpl.java @@ -43,7 +43,7 @@ public class TraceResultInterpreterImpl implements TraceResultInterpreter { @Override public TracingResult interpret(@NotNull StreamChain chain, @NotNull ArrayReference resultArray) { final ArrayReference info = (ArrayReference)resultArray.getValue(0); - final Value streamResult = resultArray.getValue(1); + final Value streamResult = ((ArrayReference)resultArray.getValue(1)).getValue(0); final Value time = resultArray.getValue(2); logTime(time); final List trace = getTrace(chain, info); diff --git a/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/GenericType.java b/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/GenericType.java index 6a7ea99..2cfc609 100644 --- a/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/GenericType.java +++ b/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/GenericType.java @@ -27,6 +27,7 @@ public interface GenericType { @NotNull String getGenericTypeName(); + GenericType BOOLEAN = new GenericTypeImpl("boolean", "java.lang.Boolean"); GenericType INT = new GenericTypeImpl("int", "java.lang.Integer"); GenericType DOUBLE = new GenericTypeImpl("double", "java.lang.Double"); GenericType LONG = new GenericTypeImpl("long", "java.lang.Long"); diff --git a/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/GenericTypeUtil.java b/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/GenericTypeUtil.java new file mode 100644 index 0000000..62f377f --- /dev/null +++ b/src/main/java/com/intellij/debugger/streams/trace/impl/handler/type/GenericTypeUtil.java @@ -0,0 +1,45 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.debugger.streams.trace.impl.handler.type; + +import com.intellij.psi.CommonClassNames; +import com.intellij.psi.PsiType; +import com.intellij.psi.util.InheritanceUtil; +import org.jetbrains.annotations.NotNull; + +/** + * @author Vitaliy.Bibaev + */ +public class GenericTypeUtil { + + public static GenericType fromStreamPsiType(@NotNull PsiType streamPsiType) { + if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_INT_STREAM)) return GenericType.INT; + if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_LONG_STREAM)) return GenericType.LONG; + if (InheritanceUtil.isInheritor(streamPsiType, CommonClassNames.JAVA_UTIL_STREAM_DOUBLE_STREAM)) return GenericType.DOUBLE; + if (PsiType.VOID.equals(streamPsiType)) return GenericType.VOID; + + return GenericType.OBJECT; + } + + public static GenericType fromPsiType(@NotNull PsiType type) { + if (PsiType.VOID.equals(type)) return GenericType.VOID; + if (PsiType.INT.equals(type)) return GenericType.INT; + if (PsiType.DOUBLE.equals(type)) return GenericType.DOUBLE; + if (PsiType.LONG.equals(type)) return GenericType.LONG; + if (PsiType.BOOLEAN.equals(type)) return GenericType.BOOLEAN; + return GenericType.OBJECT; + } +} diff --git a/src/main/java/com/intellij/debugger/streams/ui/impl/EvaluationAwareTraceWindow.java b/src/main/java/com/intellij/debugger/streams/ui/impl/EvaluationAwareTraceWindow.java index 928f95f..64db871 100644 --- a/src/main/java/com/intellij/debugger/streams/ui/impl/EvaluationAwareTraceWindow.java +++ b/src/main/java/com/intellij/debugger/streams/ui/impl/EvaluationAwareTraceWindow.java @@ -27,6 +27,7 @@ import com.intellij.ui.JBCardLayout; import com.intellij.ui.JBTabsPaneImpl; import com.intellij.ui.components.JBLabel; +import com.intellij.util.ui.JBDimension; import com.intellij.xdebugger.XDebugSession; import com.intellij.xdebugger.XDebugSessionListener; import com.sun.jdi.Value; @@ -47,6 +48,8 @@ * @author Vitaliy.Bibaev */ public class EvaluationAwareTraceWindow extends DialogWrapper { + private static final int DEFAULT_WIDTH = 870; + private static final int DEFAULT_HEIGHT = 400; private static final String FLAT_MODE_NAME = "Flat Mode"; private static final String TABBED_MODE_NAME = "Split Mode"; private final JPanel myCenterPane; @@ -81,6 +84,7 @@ public void sessionStopped() { myFlatContent = new MyPlaceholder(); myCenterPane.add(myFlatContent); + myCenterPane.setPreferredSize(new JBDimension(DEFAULT_WIDTH, DEFAULT_HEIGHT)); init(); } diff --git a/src/main/java/com/intellij/debugger/streams/wrapper/TerminatorStreamCall.java b/src/main/java/com/intellij/debugger/streams/wrapper/TerminatorStreamCall.java index c663c20..ce7ad58 100644 --- a/src/main/java/com/intellij/debugger/streams/wrapper/TerminatorStreamCall.java +++ b/src/main/java/com/intellij/debugger/streams/wrapper/TerminatorStreamCall.java @@ -15,9 +15,13 @@ */ package com.intellij.debugger.streams.wrapper; +import com.intellij.debugger.streams.trace.impl.handler.type.GenericType; +import org.jetbrains.annotations.NotNull; + /** * @author Vitaliy.Bibaev */ public interface TerminatorStreamCall extends StreamCall, TypeBeforeAwareCall { - boolean isVoid(); + @NotNull + GenericType getResultType(); } diff --git a/src/main/java/com/intellij/debugger/streams/wrapper/impl/StreamChainBuilderImpl.java b/src/main/java/com/intellij/debugger/streams/wrapper/impl/StreamChainBuilderImpl.java index 0f866fd..4490b41 100644 --- a/src/main/java/com/intellij/debugger/streams/wrapper/impl/StreamChainBuilderImpl.java +++ b/src/main/java/com/intellij/debugger/streams/wrapper/impl/StreamChainBuilderImpl.java @@ -16,6 +16,7 @@ package com.intellij.debugger.streams.wrapper.impl; import com.intellij.debugger.streams.trace.impl.handler.type.GenericType; +import com.intellij.debugger.streams.trace.impl.handler.type.GenericTypeUtil; import com.intellij.debugger.streams.wrapper.*; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.Computable; @@ -106,8 +107,8 @@ public StreamChain build(@NotNull PsiElement startElement) { prevCallType = currentType; } else if (StreamCallType.TERMINATOR.equals(type)) { - final TerminatorStreamCallImpl terminator = - new TerminatorStreamCallImpl(callName, callArgs, prevCallType, currentType.equals(GenericType.VOID)); + final GenericType genericType = resolveTerminationCallType(methodCall); + final TerminatorStreamCallImpl terminator = new TerminatorStreamCallImpl(callName, callArgs, prevCallType, genericType); return new StreamChainImpl(producer, intermediateStreamCalls, terminator, startElement); } else { @@ -126,27 +127,20 @@ else if (StreamCallType.TERMINATOR.equals(type)) { private static GenericType resolveType(@NotNull PsiMethodCallExpression call) { return ApplicationManager.getApplication().runReadAction((Computable)() -> { final PsiMethod method = call.resolveMethod(); - if (method != null) { - final PsiType returnType = method.getReturnType(); - if (returnType != null) { - if (InheritanceUtil.isInheritor(returnType, CommonClassNames.JAVA_UTIL_STREAM_INT_STREAM)) { - return GenericType.INT; - } - if (InheritanceUtil.isInheritor(returnType, CommonClassNames.JAVA_UTIL_STREAM_LONG_STREAM)) { - return GenericType.LONG; - } - if (InheritanceUtil.isInheritor(returnType, CommonClassNames.JAVA_UTIL_STREAM_DOUBLE_STREAM)) { - return GenericType.DOUBLE; - } - - if (returnType.equals(PsiType.VOID)) { - return GenericType.VOID; - } + if (method == null) return null; + final PsiType returnType = method.getReturnType(); + if (returnType == null) return null; + return GenericTypeUtil.fromStreamPsiType(returnType); + }); + } - return GenericType.OBJECT; - } - } - return null; + private static GenericType resolveTerminationCallType(@NotNull PsiMethodCallExpression call) { + return ApplicationManager.getApplication().runReadAction((Computable)() -> { + final PsiMethod method = call.resolveMethod(); + if (method == null) return null; + final PsiType returnType = method.getReturnType(); + if (returnType == null) return null; + return GenericTypeUtil.fromPsiType(returnType); }); } diff --git a/src/main/java/com/intellij/debugger/streams/wrapper/impl/TerminatorStreamCallImpl.java b/src/main/java/com/intellij/debugger/streams/wrapper/impl/TerminatorStreamCallImpl.java index 1ee318d..68258e0 100644 --- a/src/main/java/com/intellij/debugger/streams/wrapper/impl/TerminatorStreamCallImpl.java +++ b/src/main/java/com/intellij/debugger/streams/wrapper/impl/TerminatorStreamCallImpl.java @@ -25,12 +25,12 @@ */ public class TerminatorStreamCallImpl extends StreamCallImpl implements TerminatorStreamCall { private final GenericType myTypeBefore; - private final boolean myIsVoid; + private final GenericType myReturnType; - TerminatorStreamCallImpl(@NotNull String name, @NotNull String args, @NotNull GenericType typeBefore, boolean isVoid) { + TerminatorStreamCallImpl(@NotNull String name, @NotNull String args, @NotNull GenericType typeBefore, GenericType resultType) { super(name, args, StreamCallType.TERMINATOR); myTypeBefore = typeBefore; - myIsVoid = isVoid; + myReturnType = resultType; } @NotNull @@ -39,8 +39,9 @@ public GenericType getTypeBefore() { return myTypeBefore; } + @NotNull @Override - public boolean isVoid() { - return myIsVoid; + public GenericType getResultType() { + return myReturnType; } } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 5b7603f..fcc180c 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,7 +1,7 @@ org.jetbrains.debugger.streams Java Streams Debugger - 0.0.8 + 0.0.9 JetBrains IntStream.of(1, 3).anyMatch(x -> x % 2 == 0); + } +} diff --git a/testData/chain/positive/terminationType/DoubleType.java b/testData/chain/positive/terminationType/DoubleType.java new file mode 100644 index 0000000..725cff6 --- /dev/null +++ b/testData/chain/positive/terminationType/DoubleType.java @@ -0,0 +1,7 @@ +import java.util.stream.DoubleStream; + +public class Baz { + public static void bar() { + DoubleStream.of(1, 2, 3).sum(); + } +} diff --git a/testData/chain/positive/terminationType/IntType.java b/testData/chain/positive/terminationType/IntType.java new file mode 100644 index 0000000..86558fd --- /dev/null +++ b/testData/chain/positive/terminationType/IntType.java @@ -0,0 +1,7 @@ +import java.util.stream.IntStream; + +public class Baz { + public static void bar() { + IntStream.of(1, 2, 3).sum(); + } +} diff --git a/testData/chain/positive/terminationType/LongType.java b/testData/chain/positive/terminationType/LongType.java new file mode 100644 index 0000000..3ec8a7a --- /dev/null +++ b/testData/chain/positive/terminationType/LongType.java @@ -0,0 +1,7 @@ +import java.util.stream.LongStream; + +public class Baz { + public static void bar() { + LongStream.of(1, 2, 3).sum(); + } +} diff --git a/testData/chain/positive/terminationType/ReferenceType.java b/testData/chain/positive/terminationType/ReferenceType.java new file mode 100644 index 0000000..146eff0 --- /dev/null +++ b/testData/chain/positive/terminationType/ReferenceType.java @@ -0,0 +1,7 @@ +import java.util.stream.IntStream; + +public class Baz { + public static void bar() { + final int[] res = IntStream.of(1, 2).toArray(); + } +} diff --git a/testData/chain/positive/terminationType/VoidType.java b/testData/chain/positive/terminationType/VoidType.java new file mode 100644 index 0000000..51277e8 --- /dev/null +++ b/testData/chain/positive/terminationType/VoidType.java @@ -0,0 +1,8 @@ +import java.util.stream.Stream; + +public class Baz { + public static void bar() { + Stream.of(1).forEach(x -> { + }); + } +} diff --git a/testData/debug/outs/primitiveResultBoolean.out b/testData/debug/outs/primitiveResultBoolean.out new file mode 100644 index 0000000..a59897e --- /dev/null +++ b/testData/debug/outs/primitiveResultBoolean.out @@ -0,0 +1,19 @@ +LineBreakpoint created at PrimitiveResultBoolean.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! PrimitiveResultBoolean +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +PrimitiveResultBoolean.java:5 +Stream.of(1) +.anyMatch(x -> x == 2) +Result type:boolean +value = false +Stream.of + before: nothing + after: 1 +anyMatch + before: 1 + after: nothing +mappings for anyMatch + nothing -> 1 -> nothing +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/testData/debug/outs/primitiveResultDouble.out b/testData/debug/outs/primitiveResultDouble.out new file mode 100644 index 0000000..bdfc1a9 --- /dev/null +++ b/testData/debug/outs/primitiveResultDouble.out @@ -0,0 +1,21 @@ +LineBreakpoint created at PrimitiveResultDouble.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! PrimitiveResultDouble +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +PrimitiveResultDouble.java:5 +DoubleStream.of(1, 2, 3) +.sum() +Result type:double +value = 6.0 +DoubleStream.of + before: nothing + after: 1,2,3 +sum + before: 1,2,3 + after: nothing +mappings for sum + nothing -> 1 -> nothing + nothing -> 2 -> nothing + nothing -> 3 -> nothing +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/testData/debug/outs/primitiveResultInt.out b/testData/debug/outs/primitiveResultInt.out new file mode 100644 index 0000000..ba88205 --- /dev/null +++ b/testData/debug/outs/primitiveResultInt.out @@ -0,0 +1,20 @@ +LineBreakpoint created at PrimitiveResultInt.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! PrimitiveResultInt +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +PrimitiveResultInt.java:5 +IntStream.of(1, 2) +.sum() +Result type:int +value = 3 +IntStream.of + before: nothing + after: 1,2 +sum + before: 1,2 + after: nothing +mappings for sum + nothing -> 1 -> nothing + nothing -> 2 -> nothing +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/testData/debug/outs/primitiveResultLong.out b/testData/debug/outs/primitiveResultLong.out new file mode 100644 index 0000000..1cff32b --- /dev/null +++ b/testData/debug/outs/primitiveResultLong.out @@ -0,0 +1,20 @@ +LineBreakpoint created at PrimitiveResultLong.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! PrimitiveResultLong +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +PrimitiveResultLong.java:5 +IntStream.of(1, 2) +.count() +Result type:long +value = 2 +IntStream.of + before: nothing + after: 1,2 +count + before: 1,2 + after: nothing +mappings for count + nothing -> 1 -> nothing + nothing -> 2 -> nothing +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/testData/debug/outs/sortedSignedDoubleZeros.out b/testData/debug/outs/sortedSignedDoubleZeros.out new file mode 100644 index 0000000..5972b09 --- /dev/null +++ b/testData/debug/outs/sortedSignedDoubleZeros.out @@ -0,0 +1,25 @@ +LineBreakpoint created at SortedSignedDoubleZeros.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! SortedSignedDoubleZeros +Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' +SortedSignedDoubleZeros.java:5 +DoubleStream.of(0., -0.) +.sorted() +.sum() +DoubleStream.of + before: nothing + after: 1,2 +sorted + before: 1,2 + after: 3,4 +sum + before: 3,4 + after: nothing +mappings for sorted + nothing -> 1 -> 4 + nothing -> 2 -> 3 +mappings for sum + 2 -> 3 -> nothing + 1 -> 4 -> nothing +Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' + +Process finished with exit code 0 diff --git a/testData/debug/src/PrimitiveResultBoolean.java b/testData/debug/src/PrimitiveResultBoolean.java new file mode 100644 index 0000000..cdc88f9 --- /dev/null +++ b/testData/debug/src/PrimitiveResultBoolean.java @@ -0,0 +1,8 @@ +import java.util.stream.Stream; + +public class PrimitiveResultBoolean { + public static void main(String[] args) { + // Breakpoint! + boolean res = Stream.of(1).anyMatch(x -> x == 2); + } +} diff --git a/testData/debug/src/PrimitiveResultDouble.java b/testData/debug/src/PrimitiveResultDouble.java new file mode 100644 index 0000000..00d21de --- /dev/null +++ b/testData/debug/src/PrimitiveResultDouble.java @@ -0,0 +1,8 @@ +import java.util.stream.DoubleStream; + +public class PrimitiveResultDouble { + public static void main(String[] args) { + // Breakpoint! + double res = DoubleStream.of(1, 2, 3).sum(); + } +} diff --git a/testData/debug/src/PrimitiveResultInt.java b/testData/debug/src/PrimitiveResultInt.java new file mode 100644 index 0000000..a756ea8 --- /dev/null +++ b/testData/debug/src/PrimitiveResultInt.java @@ -0,0 +1,8 @@ +import java.util.stream.IntStream; + +public class PrimitiveResultInt { + public static void main(String[] args) { + // Breakpoint! + int res = IntStream.of(1, 2).sum(); + } +} diff --git a/testData/debug/src/PrimitiveResultLong.java b/testData/debug/src/PrimitiveResultLong.java new file mode 100644 index 0000000..0eabcd0 --- /dev/null +++ b/testData/debug/src/PrimitiveResultLong.java @@ -0,0 +1,8 @@ +import java.util.stream.IntStream; + +public class PrimitiveResultLong { + public static void main(String[] args) { + // Breakpoint! + long res = IntStream.of(1, 2).count(); + } +} diff --git a/testData/debug/src/SortedSignedDoubleZeros.java b/testData/debug/src/SortedSignedDoubleZeros.java new file mode 100644 index 0000000..d425fac --- /dev/null +++ b/testData/debug/src/SortedSignedDoubleZeros.java @@ -0,0 +1,8 @@ +import java.util.stream.DoubleStream; + +public class SortedSignedDoubleZeros { + public static void main(String[] args) { + // Breakpoint! + double sum = DoubleStream.of(0., -0.).sorted().sum(); + } +}