Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 398687

Summary: [breakpoints] Class file breakpoints throw exceptions after update
Product: [Eclipse Project] JDT Reporter: Michael Rennie <Michael_Rennie>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: thatnitind
Version: 4.3   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description Michael Rennie CLA 2013-01-21 16:29:31 EST
Version: 4.3.0
Build id: N20130120-2000

and previous versions

If you create a line breakpoint on a class file in an Eclipse plugin and then update Eclipse, trying to select the breakpoint in the view throws a cryptic exception:

null
Error
Mon Jan 21 15:04:44 CST 2013
org.eclipse.ant.tests.ui does not exist

In the example case I had a classflle breakpoint on org.eclipse.ui.editors.text.TextEditor line 93.

The problem is coming from the fact that we store the IJavaElement handle in the underlying marker so when we try to look up the type for the breakpoint it blows up. For example here is the exported breakpoint for the above exception:

<?xml version="1.0" encoding="UTF-8"?>
<breakpoints>
<breakpoint enabled="true" persistant="true" registered="true">
<resource path="/" type="8"/>
<marker charStart="2963" lineNumber="93" type="org.eclipse.jdt.debug.javaLineBreakpointMarker">
<attrib name="message" value="Line breakpoint:TextEditor [line: 93] - dispose()"/>
<attrib name="org.eclipse.debug.core.id" value="org.eclipse.jdt.debug"/>
<attrib name="org.eclipse.jdt.debug.ui.JAVA_ELEMENT_HANDLE_ID" value="=org.eclipse.ant.tests.ui/\/Eclipse\/eclipse\/plugins\/org.eclipse.ui.editors_3.8.100.N20130113-2000.jar&lt;org.eclipse.ui.editors.text(TextEditor.class[TextEditor"/>
<attrib name="charStart" value="2963"/>
<attrib name="org.eclipse.jdt.debug.core.suspendPolicy" value="2"/>
<attrib name="charEnd" value="2981"/>
<attrib name="org.eclipse.jdt.debug.core.installCount" value="0"/>
<attrib name="org.eclipse.jdt.internal.core.JavaModelManager.handleId" value="=org.eclipse.ant.tests.ui/\/Eclipse\/eclipse\/plugins\/org.eclipse.ui.editors_3.8.100.N20130113-2000.jar&lt;org.eclipse.ui.editors.text(TextEditor.class"/>
<attrib name="org.eclipse.debug.core.enabled" value="true"/>
<attrib name="org.eclipse.jdt.debug.core.typeName" value="org.eclipse.ui.editors.text.TextEditor"/>
<attrib name="workingset_name" value=""/>
<attrib name="workingset_id" value="org.eclipse.debug.ui.breakpointWorkingSet"/>
</marker>
</breakpoint>
</breakpoints>

I also noticed that we duplicate the handle infos in the breakpoint marker.
Comment 1 Michael Rennie CLA 2013-01-21 16:46:00 EST
In the case of classfiles when we try to compute the IType perhaps we should check if it exists and if not try to find it then update the handle.

The exception is being thrown from JavaBreakpointConditionEditor line 271

else {
  IClassFile classFile = type.getClassFile();
  if (classFile != null) {
    source = classFile.getSource(); <--
  }
}
Comment 2 Eclipse Genie CLA 2020-04-26 14:25:58 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.