This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Build 200404191800, j2sdk1.4.2_04 How to reproduce: - select one line in the editor (shift arrow-down, control-c) - repeat several times paste activity (control-v) - try to place a breakpoint using gutter (click) on the pasted lines
It is reproducible by these steps too : - hit sometimes Enter key in a method body - try place breakpoint (ctrl-F8) in the method -> The brekpoint is pleced not on the row where is caret, but on row number + count of Enters (it is not related directly with clipboard)
As it does not happen with other annotations (e.g. Bookmark) I guess that the problem lies in the debugger's action that attaches the breakpoint. I've inspected debugger's ToggleBreakpointAction and then Context.getCurrentLineNumber() but as it searches in lookup I pass this to debugger for further evaluation.
Is there any comment from debugger guys? This issue was marked as future Q-build stopper.
We can not effectivelly fix it because of 42755. I would like to mention that problems with breakpoints in modificated code are in NetBeans all the time from begining. There are two possibilities: 1) you will see breakpoint on the right place & but internally it will be placed on bas line number (NB36 situation) 2) you will see sometimes breakpoint on a bad position, but internal line number will be OK. I would like to wait on 42755.
*** Issue 42754 has been marked as a duplicate of this issue. ***
fixed in the main trunk: Revision Changes Path 1.9 +9 -1 debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java http://debuggerjpda.netbeans.org/source/browse/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java.diff?r1=1.8&r2=1.9 (In the diff below, changes in quantity of whitespace are not shown.) Index: ContextProviderImpl.java =================================================================== RCS file: /cvs/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -b -r1.8 -r1.9 --- ContextProviderImpl.java 13 May 2004 13:14:19 -0000 1.8 +++ ContextProviderImpl.java 17 May 2004 22:15:15 -0000 1.9 @@ -42,6 +42,7 @@ import java.net.URL; import java.net.MalformedURLException; +import java.util.List; import javax.swing.text.Document; import javax.swing.text.StyledDocument; import org.openide.filesystems.FileStateInvalidException; @@ -126,7 +127,14 @@ LineCookie lineCookie = getCurrentLineCookie (); Line.Set lineSet = lineCookie.getLineSet (); try { - ln = 2 * ln - lineSet.getOriginal (ln).getLineNumber (); + //ln = 2 * ln - lineSet.getOriginal (ln).getLineNumber (); + List l = lineSet.getLines (); + int i, k = l.size (); + for (i = 0; i < k; i++) { + if (((Line) l.get (i)).getLineNumber () >= ln) { + return i + 1; + } + } return ln + 1; } catch (IndexOutOfBoundsException ex) { ex.printStackTrace ();
Probably not too good fix: why not call: set.getLines().indexOf (line)?
because it returns completely different information than I need. I need getoriginalLineNumber for LineSet.getCurrent (currnet) line... It looks like you do not know how it works...
*** Issue 43503 has been marked as a duplicate of this issue. ***
*** Issue 44179 has been marked as a duplicate of this issue. ***
*** Issue 43629 has been marked as a duplicate of this issue. ***
I have done some API changes connected with this bug: Checking in ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java; /cvs/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java,v <-- ContextProviderImpl.java new revision: 1.19; previous revision: 1.18 done Checking in ant/src/org/netbeans/modules/debugger/projects/DebuggerAnnotation.java; /cvs/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/DebuggerAnnotation.java,v <-- DebuggerAnnotation.java new revision: 1.5; previous revision: 1.4 done Processing log script arguments... More commits to come... Checking in api/src/org/netbeans/spi/debugger/jpda/ContextProvider.java; /cvs/debuggerjpda/api/src/org/netbeans/spi/debugger/jpda/ContextProvider.java,v <-- ContextProvider.java new revision: 1.9; previous revision: 1.8 done Processing log script arguments... More commits to come... Checking in src/org/netbeans/modules/debugger/jpda/Context.java; /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/Context.java,v <-- Context.java new revision: 1.2; previous revision: 1.1 done Processing log script arguments... More commits to come... Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/Context.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/Context.java,v <-- Context.java new revision: 1.11; previous revision: 1.10 done Processing log script arguments... More commits to come... Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointAnnotationListener.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointAnnotationListener.java,v <-- BreakpointAnnotationListener.java new revision: 1.2; previous revision: 1.1 done
Mostly fixed: Checking in ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java; /cvs/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ContextProviderImpl.java,v <-- ContextProviderImpl.java new revision: 1.21; previous revision: 1.20 done Checking in ant/src/org/netbeans/modules/debugger/projects/DebuggerAnnotation.java; /cvs/debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/DebuggerAnnotation.java,v <-- DebuggerAnnotation.java new revision: 1.6; previous revision: 1.5 done Processing log script arguments... More commits to come... Checking in api/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java; /cvs/debuggerjpda/api/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java,v <-- LineBreakpoint.java new revision: 1.6; previous revision: 1.5 done Processing log script arguments... More commits to come... Checking in api/src/org/netbeans/spi/debugger/jpda/ContextProvider.java; /cvs/debuggerjpda/api/src/org/netbeans/spi/debugger/jpda/ContextProvider.java,v <-- ContextProvider.java new revision: 1.11; previous revision: 1.10 done Processing log script arguments... More commits to come... Checking in src/org/netbeans/modules/debugger/jpda/Context.java; /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/Context.java,v <-- Context.java new revision: 1.4; previous revision: 1.3 done Checking in src/org/netbeans/modules/debugger/jpda/EngineContext.java; /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/EngineContext.java,v <-- EngineContext.java new revision: 1.4; previous revision: 1.3 done Checking in src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java; /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java,v <-- JPDADebuggerImpl.java new revision: 1.37; previous revision: 1.36 done Processing log script arguments... More commits to come... Checking in test/unit/src/org/netbeans/api/debugger/jpda/test/TestContextProvider.java; /cvs/debuggerjpda/test/unit/src/org/netbeans/api/debugger/jpda/test/TestContextProvider.java,v <-- TestContextProvider.java new revision: 1.3; previous revision: 1.2 done Processing log script arguments... More commits to come... RCS file: /cvs/debuggerjpda/ui/src/META-INF/debugger/org.netbeans.modules.debugger.jpda.ui.breakpoints.BreakpointAnnotationListener,v done Checking in ui/src/META-INF/debugger/org.netbeans.modules.debugger.jpda.ui.breakpoints.BreakpointAnnotationListener; /cvs/debuggerjpda/ui/src/META-INF/debugger/org.netbeans.modules.debugger.jpda.ui.breakpoints.BreakpointAnnotationListener,v <-- org.netbeans.modules.debugger.jpda.ui.breakpoints.BreakpointAnnotationListener initial revision: 1.1 done Processing log script arguments... More commits to come... Checking in ui/src/META-INF/debugger/netbeans-JPDASession/Java/org.netbeans.api.debugger.LazyActionsManagerListener; /cvs/debuggerjpda/ui/src/META-INF/debugger/netbeans-JPDASession/Java/org.netbeans.api.debugger.LazyActionsManagerListener,v <-- org.netbeans.api.debugger.LazyActionsManagerListener new revision: 1.3; previous revision: 1.2 done Processing log script arguments... More commits to come... Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/Context.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/Context.java,v <-- Context.java new revision: 1.13; previous revision: 1.12 done Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/CurrentThreadAnnotationListener.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/CurrentThreadAnnotationListener.java,v <-- CurrentThreadAnnotationListener.java new revision: 1.7; previous revision: 1.6 done Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/DebuggerOutput.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/DebuggerOutput.java,v <-- DebuggerOutput.java new revision: 1.13; previous revision: 1.12 done Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/EngineContext.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/EngineContext.java,v <-- EngineContext.java new revision: 1.10; previous revision: 1.9 done Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/IOManager.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/IOManager.java,v <-- IOManager.java new revision: 1.11; previous revision: 1.10 done Processing log script arguments... More commits to come... Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/actions/ToggleBreakpointActionProvider.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/actions/ToggleBreakpointActionProvider.java,v <-- ToggleBreakpointActionProvider.java new revision: 1.7; previous revision: 1.6 done Processing log script arguments... More commits to come... Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointAnnotationListener.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointAnnotationListener.java,v <-- BreakpointAnnotationListener.java new revision: 1.3; previous revision: 1.2 done RCS file: /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointsUpdater.java,v done Checking in ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointsUpdater.java; /cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/BreakpointsUpdater.java,v <-- BreakpointsUpdater.java initial revision: 1.1 done
Seems to be fixed in the build 200406230100 (at least for my test case) so I don't understand why issue's status is REOPENED. Is it related to outstanding API changes?
This bug should be fixed in trunk. There are several differen usecases how to tes this functionality. Each usecas tests different "part of code". Usecase I. ---------- 1) open main class file 2) edit file (add some new lines) 3) add line breakpoints there # this basic test verifies if breakpoints are added to "current" line not "original" once Usecase II. ----------- 1) open main class file 2) add line breakpoints there 3) edit file (add some new lines) 4) start debugging (file is compiled automatically) 5) test if breakpoints are reached, and if Step Over traces correctly through the source code # this test verifies if breakpoint line numbers are updated, when the file is compiled and debugger is started Usecase III. ------------ 1) open main class file 2) start debugging (file is compiled automatically) 3) add line breakpoints there 4) edit file (add some new lines) 5) test if breakpoints are reached, and if Step Over traces correctly through the source code # this test verifies if getOriginal and getCurrent are used correctly Usecase IV. ------------ 1) open main class file 2) start debugging (file is compiled automatically) 3) edit file (add some new lines) 4) compile file 5) add line breakpoints there 6) test if breakpoints are reached, and if Step Over traces correctly through the source code # this test verifies if the original line set is managed properly by the debugger session All these usecases should work now. QA, can you add them to your testplans? Thanks.
Seems to be fixes in build QBE200406242325, verified