Community
Participate
Working Groups
I20110504-0800 - import org.eclipse.jdt.ui as source (from CVS or using the PDE importer) - open type ModifyDialog - double-click the left ruler on line 94 to set a watchpoint for field private final Map<String, String> fWorkingValues; => watchpoint is not created, exception in log: org.eclipse.jface.text.BadLocationException at org.eclipse.jface.text.ListLineTracker.getLineInformation(ListLineTracker.java:180) at org.eclipse.jface.text.AbstractLineTracker.getLineInformation(AbstractLineTracker.java:137) at org.eclipse.jface.text.AbstractDocument.getLineInformation(AbstractDocument.java:929) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineInformation(SynchronizableDocument.java:337) at org.eclipse.jdt.internal.debug.ui.actions.ToggleBreakpointAdapter$2.run(ToggleBreakpointAdapter.java:261) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Simpler example: package xy; public class Try { private final String fWorkingValues; // Breakpoint here Try() { fWorkingValues= null; System.out.println(fWorkingValues); } }
We end up falling back to setting a line breakpoint on the next valid line (since you can't set a watchpoint on a final field), the problem is that we do not have a validator when we invoke toggleBreakpoints, so we are guessing the wrong location.
There was even a bit more to it - we were creating two jobs in place of one, passing a bogus value for a line number and allowing final field to be found as valid locations for watchpoints in our AST visitor. Pushed fix to: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=20b68383657cd467297bd15f92d8b6233809a6c0