Community
Participate
Working Groups
The following NPE ensures I don't get any work done. java.lang.NullPointerException at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.getEnclosingReferenceTypeName(JavaBreakpoint.java:242) at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.createRequests(JavaBreakpoint.java:595) at org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint.addToTarget(JavaBreakpoint.java:584) at org.eclipse.jdt.internal.debug.core.breakpoints.JavaLineBreakpoint.addToTarget(JavaLineBreakpoint.java:172) at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.breakpointAdded(JDIDebugTarget.java:1287) at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.initializeBreakpoints(JDIDebugTarget.java:522) at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.initialize(JDIDebugTarget.java:448) at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.<init>(JDIDebugTarget.java:315) at org.eclipse.jdt.debug.core.JDIDebugModel$1.run(JDIDebugModel.java:183) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345) at org.eclipse.jdt.debug.core.JDIDebugModel.newDebugTarget(JDIDebugModel.java:187) at org.eclipse.jdt.internal.launching.StandardVMDebugger.createDebugTarget(StandardVMDebugger.java:471) at org.eclipse.jdt.internal.launching.StandardVMDebugger.run(StandardVMDebugger.java:347) at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:174) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018) at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
The unit test that shows this bug: package eclipsetest; import org.junit.Assert; import org.junit.Test; public class UnitTest { public abstract static class FooProvider { public abstract FooInterface provide(); } public interface FooInterface { } public abstract static class FooSimpleExtensionPoint implements FooInterface { public abstract boolean include(); } @Test public void foo() { class BarProvider extends FooProvider { @Override public FooInterface provide() { FooInterface iface = new FooSimpleExtensionPoint() { @Override public boolean include() { System.out.println("Breakpoint fails here"); return false; } }; return iface; } } FooProvider p = new BarProvider(); Assert.assertNotNull(p); } }
looks like you have a breakpoint with no backing type name (which is allowed in theory), but we do not check for null-ness in the breakpoint call-back
This bug is really troublesome. Once a breakpoint is invalid, we can't remove it, since going to the breakpoints tab fails to show any breakpoints. A restart of the workbench won't help, since the breakpoint is persisted. I don't know where to go to clear the breakpoints manually. Essentially, my entire workspace is broken and I cannot fix it without starting a new one.
Marking as critical since my workspace is now broken.
Workaround: In breakpoint view, right-click, and select "Remove All". This workaround is not intuitive, though, since most users will see the empty view and assume there already are 0 breakpoints declared.
Created attachment 246383 [details] fix This patch makes sure we check for nullness before using the typename from a breakpoint and adds unit tests for the model presentation + launching with null-typed breakpoints.
Pushed fix + tests to: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=563fa449866443a45146acc758ca64c11f758e4c bundle version updates: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=d23a9c944cadd49babf469ceb42b512ea3386525
Verified with the tests using Eclipse SDK Version: Mars (4.5) Build id: I20140916-2000