You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Breakpoint doesn't work on lambdas which returns a generic type #498
package com.example.demo;
import java.util.Optional;
import java.util.function.Function;
public class Test {
public static void main(String[] args) {
map(t -> Optional.ofNullable(t), "Null").isPresent();
}
private static <T, R> Optional<? extends R> map(Function<? super T, ? extends Optional<? extends R>> mapper, T value) {
return mapper.apply(value);
}
}
package com.example.demo;
import java.util.Optional;
import java.util.function.Function;
public class Test {
public static void main(String[] args) {
map(t -> Optional.ofNullable(t), "Null").isPresent();
}
private static <T, R> Optional<R> map(Function<T, Optional<R>> mapper, T value) {
return mapper.apply(value);
}
}
package com.example.demo;
import java.util.Optional;
import java.util.function.Function;
public class Test {
public static void main(String[] args) {
map(t -> Optional.ofNullable(t), "Null").isPresent();
}
private static Optional<String> map(Function<String, Optional<String>> mapper, String value) {
return mapper.apply(value);
}
}
Environment
Operating System: Any
JDK version: 17
Visual Studio Code version: 1.79.2
Java extension version: 1.20
Java Debugger extension version: 0.52
Steps To Reproduce
Add inline breakpoint into t -> Optional.ofNullable(t)
Run the program
Current Result
The breakpoint doesn't work
Expected Result
The execution should stop at the lambda
Additional Informations
The issue is when trying to find lambda methods from the debugger API, the method object doesn't provide the generic signature, But the signature we try to match has the generic signature which cause the match failure.
Activity
gayanper commentedon Jul 1, 2023
If I change the
mapmethod toeverything works