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.
Debugger could warn user there are breakpoints (line, field, method or class) which cannot be reached because appropriate sources are not enabled or available. Such breakpoints could be differentiated by modified icons and logged in debugger console like invalid breakpoints.
set as usability defect
We'll analyze what can we do with this, we need to assure that the user will not get red warning messages from projects unrelated to the debugged project.
For NB6 I suggest the following approach: When submitting a breakpoint request also check the source code is available for debugging. If it is not, mark the breakpoint as invalid with an appropriate explanation (tooltip and debugger output window).
Or we can try to do more: When submitting a bpkt request, check the source code is available for debugging. If it is not, add the source code to the Sources View, and display an info about that in the debugger output. If this is not desired beahavior, users may still unchecked the source again or make the bpkt disabled.
Well, I've realized that when we do the automatic enablement of the sources in which the breakpoint resides, we have so distinguish whether these sources were intentionally unchecked by the user, or whether they were just initially unchecked. But this info is not available when dealing with breakpoints, we would have to somehow hack into the SourcePath implementation.
Implemented in trunk, please verify that the functionality is as desired. When breakpoints are set into sources which are disabled for debugging and which belongs to the project's source path, they are invalidated with the description like: Not able to submit breakpoint LineBreakpoint Object.java : 24, reason: Breakpoint belongs to disabled source root '/opt/java/jdk1.6.0_02_b01/src.zip'. See Window/Debugging/Sources. /shared/data/ccvs/repository/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/SourcePathProviderImpl.java,v <-- SourcePathProviderImpl.java new revision: 1.7; previous revision: 1.6 /shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/SourcePath.java,v <-- SourcePath.java new revision: 1.10; previous revision: 1.9 /shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/Bundle.properties,v <-- Bundle.properties new revision: 1.15; previous revision: 1.14 /shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/breakpoints/ClassBasedBreakpoint.java,v <-- ClassBasedBreakpoint.java new revision: 1.25; previous revision: 1.24
It seems it is not working. 1. if I try to create e.g. line breakpoint in ArrayList when the jdk sources are not enabled in sources view an exception is thrown: INFO [org.netbeans.modules.java.hints.WrongPackageSuggestion]: source cp is either null or does not contain the compiled source cp=ClassPath[] SEVERE [global] java.lang.NoSuchMethodException: org.netbeans.modules.debugger.jpda.SourcePath$CompoundContextProvider.getProjectSourceRoots() at java.lang.Class.getMethod(Class.java:1581) [catch] at org.netbeans.modules.debugger.jpda.SourcePath.getProjectSourceRoots(SourcePath.java:189) at org.netbeans.modules.debugger.jpda.breakpoints.ClassBasedBreakpoint.isEnabled(ClassBasedBreakpoint.java:126) at org.netbeans.modules.debugger.jpda.breakpoints.BreakpointImpl.update(BreakpointImpl.java:123) at org.netbeans.modules.debugger.jpda.breakpoints.BreakpointImpl.set(BreakpointImpl.java:102) at org.netbeans.modules.debugger.jpda.breakpoints.LineBreakpointImpl.<init>(LineBreakpointImpl.java:84) at org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener.createBreakpointImpl(BreakpointsEngineListener.java:217) at org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener.access$100(BreakpointsEngineListener.java:57) at org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener$1.run(BreakpointsEngineListener.java:136) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964) 2. after I tried to enable/disable the jdk sources in sources view another exception is thrown: SEVERE [global] java.lang.NoSuchMethodException: org.netbeans.modules.debugger.jpda.SourcePath$CompoundContextProvider.getProjectSourceRoots() at java.lang.Class.getMethod(Class.java:1581) [catch] at org.netbeans.modules.debugger.jpda.SourcePath.getProjectSourceRoots(SourcePath.java:189) at org.netbeans.modules.debugger.jpda.breakpoints.ClassBasedBreakpoint.isEnabled(ClassBasedBreakpoint.java:126) at org.netbeans.modules.debugger.jpda.breakpoints.BreakpointImpl.update(BreakpointImpl.java:123) at org.netbeans.modules.debugger.jpda.breakpoints.ClassBasedBreakpoint$SourceRootsChangedListener.propertyChange(ClassBasedBreakpoint.java:266) at org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:164) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333) at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:270) at org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl.setSourceRoots(SourcePathProviderImpl.java:437) at org.netbeans.modules.debugger.jpda.ui.SourcePath$CompoundContextProvider.setSourceRoots(SourcePath.java:586) at org.netbeans.modules.debugger.jpda.ui.SourcePath.setSourceRoots(SourcePath.java:167) at org.netbeans.modules.debugger.jpda.ui.models.SourcesModel.setEnabled(SourcesModel.java:279) at org.netbeans.modules.debugger.jpda.ui.models.SourcesModel.setValueAt(SourcesModel.java:198) at org.netbeans.spi.viewmodel.Models$DelegatingTableModel.setValueAt(Models.java:1428) at org.netbeans.spi.viewmodel.Models$CompoundModel.setValueAt(Models.java:2907) at org.netbeans.modules.viewmodel.TreeModelNode$MyProperty.setValue(TreeModelNode.java:989) at org.openide.explorer.view.TreeTable.editCellAt(TreeTable.java:509) at org.openide.explorer.view.TreeTable$TreeTableUI$TreeTableMouseInputHandler.processMouseEvent(TreeTable.java:1575) at org.openide.explorer.view.TreeTable$TreeTableUI$TreeTableMouseInputHandler.mousePressed(TreeTable.java:1484) 3. if I create a breakpoint in jdk sources, disable jdk sources in sources view and start debugging, the breakpoint is hit
After issue #116657 was fixed, it should work fine.
It works for line breakpoints. Field and method breakpoints are affected by issue 118086.
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.