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.

Bug 115016 - Check if sources of 'codelike' breakpoints are available
Summary: Check if sources of 'codelike' breakpoints are available
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: USABILITY
Depends on:
Blocks:
 
Reported: 2007-09-07 13:44 UTC by ehucka
Modified: 2010-04-29 09:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ehucka 2007-09-07 13:44:45 UTC
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.
Comment 1 ehucka 2007-09-13 10:28:07 UTC
set as usability defect
Comment 2 Martin Entlicher 2007-09-13 10:54:51 UTC
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.
Comment 3 Roman Ondruska 2007-09-19 14:33:58 UTC
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). 
Comment 4 Roman Ondruska 2007-09-19 15:19:01 UTC
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.
Comment 5 Martin Entlicher 2007-09-19 18:09:01 UTC
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.
Comment 6 Martin Entlicher 2007-09-20 16:14:22 UTC
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
Comment 7 ehucka 2007-09-25 10:30:52 UTC
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

Comment 8 Martin Entlicher 2007-09-25 15:51:47 UTC
After issue #116657 was fixed, it should work fine.
Comment 9 ehucka 2007-10-11 09:08:30 UTC
It works for line breakpoints. Field and method breakpoints are affected by issue 118086.
Comment 10 Quality Engineering 2010-04-29 09:35:06 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.