Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when adding lambda breakpoints in reactive projects #477

Closed
Tracked by #1201
gayanper opened this issue Apr 4, 2023 · 1 comment
Closed
Tracked by #1201

NPE when adding lambda breakpoints in reactive projects #477

gayanper opened this issue Apr 4, 2023 · 1 comment

Comments

@gayanper
Copy link
Contributor

gayanper commented Apr 4, 2023

java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.dom.IMethodBinding.getKey()" because "binding" is null
	at com.microsoft.java.debug.BindingUtils.getMethodName(BindingUtils.java:36)
	at com.microsoft.java.debug.LambdaExpressionLocator.getMethodName(LambdaExpressionLocator.java:84)
	at com.microsoft.java.debug.plugin.internal.JdtSourceLookUpProvider.getBreakpointLocations(JdtSourceLookUpProvider.java:176)
	at com.microsoft.java.debug.core.adapter.handler.SetBreakpointsRequestHandler.convertClientBreakpointsToDebugger(SetBreakpointsRequestHandler.java:312)
	at com.microsoft.java.debug.core.adapter.handler.SetBreakpointsRequestHandler.handle(SetBreakpointsRequestHandler.java:108)
	at com.microsoft.java.debug.core.adapter.DebugAdapter.lambda$dispatchRequest$0(DebugAdapter.java:93)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
	at com.microsoft.java.debug.core.adapter.DebugAdapter.dispatchRequest(DebugAdapter.java:92)
	at com.microsoft.java.debug.core.adapter.ProtocolServer.dispatchRequest(ProtocolServer.java:118)
	at com.microsoft.java.debug.core.protocol.AbstractProtocolServer.lambda$new$0(AbstractProtocolServer.java:81)
	at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
	at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
	at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
	at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
	at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

Sample Code:

import reactor.core.publisher.Mono;

public class Lambda {
    public static void main(String[] args) {
        var s = Mono.fromCallable(() -> String.valueOf(Math.random())).map(i -> i.concat("2")).block();
        System.out.println(s);
    }
}

Both lambda cause the NPE

@gayanper
Copy link
Contributor Author

gayanper commented Apr 4, 2023

Will provide a better example code to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant