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 227076 - Breakpoints of deleted Source Files not deleted
Summary: Breakpoints of deleted Source Files not deleted
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.3
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-06 05:19 UTC by bht
Modified: 2015-04-01 16:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log and properties files in zip file (37.88 KB, application/octet-stream)
2013-03-06 23:52 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2013-03-06 05:19:44 UTC
Product Version: NetBeans IDE 7.3 (Build 201302132200)

The breakpoints of files from projects that are long gone exist in the file org-netbeans-modules-debugger-Settings.properties but they don't exist in the breakpoints window.

So If I for example make a copy of one of my projects and debug the copy then delete the copy then I have ghost breakpoints that will confuse me for the rest of the life of the project.

These ghost breakpoints show up in the Debugger Console with messages "Invalid LineBreakpoint ...".

I am using the ServletStateless sample project as test project to reproduce debugger issues, then delete or move the test project outside NetBeans after having closed the project in NetBeans.

At present, I get 9 (nine) such messages for ServletSessionBean although I have set only a single breakpoint.

The debugger has various bugs that I want to make test cases for, but I cannot make the test cases because of this (I cannot clean up org-netbeans-modules-debugger-Settings.properties because it has a very bad structure).

Imagine if I want to use the debugger to debug my actual work not the NetBeans testing - then I find myself buried in layers of NetBeans debugger bugs, not only one. I actually wanted to report a different, new debugger bug. That is why this is priority 1.
Comment 1 Martin Entlicher 2013-03-06 13:31:54 UTC
All breakpoints are stored in the NetBeans user dir (org-netbeans-modules-debugger-Settings.properties file), but only breakpoints belonging to currently opened projects are visible in Breakpoints Window.
To see all known breakpoints in Breakpoints Window, click on the icon with the key on the left side of the Breakpoints Window and uncheck "From Opened Projects Only" checkbox at the bottom of the popup menu.

To clean all breakpoints and other debugger settings (watches, etc.), the org-netbeans-modules-debugger-Settings.properties file can be deleted while NetBeans are closed. It's then re-created when needed.

When a project (including the source roots) is deleted from NetBeans (or outside of NetBeans but while NetBeans are running), it's line breakpoints are also deleted.

When a project (including the source roots) is deleted or moved outside of NetBeans and while NetBeans are closed, then after NetBeans are started again, line breakpoints belonging to sources which do not exist any more are deleted.

Therefore, IMHO, in your case either some exceptions were thrown, which interrupted the breakpoints elimination and which would be in your messages.log file, or you've deleted just the project metadata without the sources.

And this is the only case in which I'm able to reproduce your issue:
1) Create a Servlet2Stateless sample project (or any Java project should work
   this way IMHO)
2) Right-click on the project in Projects window and select Copy...
3) Press Copy button
4) Open Servlet2Stateless.java file from the copied project
   (Servlet2Stateless_1)
5) Submit breakpoint to line 72
6) Debug the Servlet2Stateless_1 project, after it suspends on the
   breakpoint, press continue and finish the debugger session.
7) Delete the Servlet2Stateless_1 project, but be sure not to check on
   "Also delete sources under..." 
8) Debug the original project (Servlet2Stateless)
9) You get en error message
   "Not able to submit breakpoint LineBreakpoint Servlet2Stateless.java:72,
    reason: No source root found for URL
   'file:/tmp/NetBeansProjects/ServletStateless_1/src/java/servlet/stateless/
    Servlet2Stateless.java'. Verify the setup of project sources."
10) This message is harmless, but if you want to get rid of is, it's easy
    to click on "Invalid LineBreakpoint Servlet2Stateless.java : 72" line,
    which opens the source file and remove the breakpoint.

Since there is nothing severe in this issue, I'm reducing the priority to P3.
We can think about fixing this by ignoring breakpoints that belong to source roots without a corresponding project and not being added as an extra source root in the Sources window.
Comment 2 bht 2013-03-06 23:52:29 UTC
Created attachment 132303 [details]
log and properties files in zip file

Thanks for the analysis and explanations.

My case is not exactly as I wrote. The projects actually exist. My apologies.

However when I clicked on the links of the invalid breakpoint locations in the Debugger Console, then there was no response which lead me to assume that the files did not exist.

Now (in a new NetBeans session) when I as you suggested uncheck "From Opened Projects Only" then I can see the breakpoints of the other projects. Surprisingly, the breakpoints are now ALL valid.

At this time I don't know how I would create a testcase for the initial errors because I did not touch the other projects.

One wild assumption would be that the debugger tried to match the breakpoints of the other projects against the source of the new project with the same package and name, and later changed its mind. Perhaps an empty cache?

There are exceptions in the attached log file - however I am not suggesting that they would have caused the errors.

I would appreciate if bug 225311 could be fixed soon so that the scenarios I am running into are less complicated.
Comment 3 micahgreene2 2015-04-01 16:09:16 UTC
Try Deleting your Netbeans Project Folder and reload your project, it should clear the breakpoints out.