Skip to content

NPE when adding lambda breakpoints in reactive projects #477

Closed

Description

@gayanper
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

Activity

  1. gayanper commented on Apr 4, 2023

    @gayanper
    ContributorAuthor

    Will provide a better example code to reproduce.

  2. added a commit that references this issue on Apr 4, 2023
    d5f8b32
  3. added a commit that references this issue on May 11, 2023
    74fc126
  4. added a commit that references this issue on May 22, 2023
    fed8402
  5. added a commit that references this issue on Jan 30, 2024
    a011049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions