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 232670 - Debugger creates duplicate Breakpoints
Summary: Debugger creates duplicate Breakpoints
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.3
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-14 03:37 UTC by bht
Modified: 2013-07-29 01:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screen print (11.97 KB, image/gif)
2013-07-14 03:37 UTC, bht
Details
properties file (134.73 KB, application/octet-stream)
2013-07-14 03:37 UTC, bht
Details
Properties dialog of 1st breakpoint (21.14 KB, image/gif)
2013-07-14 03:48 UTC, bht
Details
Customize properties of the 2nd breakpoint (19.64 KB, image/gif)
2013-07-14 03:49 UTC, bht
Details
screen shot of multiple breakpoints (4.15 KB, image/gif)
2013-07-14 04:16 UTC, bht
Details
Properties file for multiple breakpoints (147.96 KB, application/octet-stream)
2013-07-14 04:19 UTC, bht
Details
log files in zip file (36.83 KB, application/octet-stream)
2013-07-26 19:03 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2013-07-14 03:37:13 UTC
Created attachment 137085 [details]
Screen print

As a prerequisite, I delete all breakpoints so the breakpoints window is empty.

In a java file in a web project I click on the gutter to create a breakpoint.

The breakpoint is set, but as two instances. I had created a project before that has the same class in the same package. But this project was closed in the IDE and subsequently deleted from disk during the same IDE session. I am not sure whether this has any relevance.

The file org-netbeans-modules-debugger-Settings.properties contains multiple entries for the same class.
Comment 1 bht 2013-07-14 03:37:56 UTC
Created attachment 137086 [details]
properties file
Comment 2 bht 2013-07-14 03:48:14 UTC
Created attachment 137087 [details]
Properties dialog of 1st breakpoint
Comment 3 bht 2013-07-14 03:49:01 UTC
Created attachment 137088 [details]
Customize properties of the 2nd breakpoint
Comment 4 bht 2013-07-14 04:16:13 UTC
Created attachment 137089 [details]
screen shot of multiple breakpoints

In the same file, I set breakpoints on a few lines. Most of them show duplicates. One of them, the last, is a single breakpoint. The debugger ignores this breakpoint.

It has been very common during the last 10 years that I found a bug and subsequently created a test case for it. In the process of creating the test case, I found another bug. This is one of them. The quality of NetBeans has improved, but the debugger is still not ready. This is not a complex case. Just a JSE JUnit execution.
Comment 5 bht 2013-07-14 04:19:22 UTC
Created attachment 137090 [details]
Properties file for multiple breakpoints
Comment 6 Martin Entlicher 2013-07-26 08:38:23 UTC
There were created both JSP and Java breakpoints in the same files and for the same lines somehow. Thanks for the detailed description.
JSP breakpoints are not deleted when the project is deleted, thus this is a bug, but I was not able to reproduce creation of JSP breakpoints in Java files. :-(
Comment 7 Martin Entlicher 2013-07-26 13:52:14 UTC
During the investigation I've fixed duplicate breakpoint annotation created during specific threading conditions:
http://hg.netbeans.org/core-main/rev/d8cfb8833f56
But I do not think it will fix this case, since here is a pair of Java and JSP breakpoints created on each line.

It's still a mystery to me, how JSP breakpoints get created in Java files.
I was playing with Calculator Web service sample project, but without any luck yet.
Can you please provide messages.log file so that we know the exact IDE version and versions of installed modules? Also there might be some relevant logging or exceptions.
Exact steps how to reproduce this with some sample project, would help.
Comment 8 bht 2013-07-26 19:03:44 UTC
Created attachment 137876 [details]
log files in zip file

I have no idea under what conditions this happened. I am not using JSP in any of my projects, except when NetBeans creates one with a sample web project. However then I do not set breakpoints in this JSP file. I deleted the org-netbeans-modules-debugger-Settings.properties file after the incident.

I am always striving to create sample project test cases but I am out of ideas this time. I am glad that you could address one issue. Perhaps you can set a trap for this JSP scenario?
Comment 9 bht 2013-07-26 19:25:52 UTC
After comparing with other IDEs, I would recommend to look at bug 226437. From my perspective, it makes no sense to keep breakpoints that have lost their scope. Obviously, things have become so complex, that I have to throw in the towel, meaning I will not be able to produce a testcase for the JSP bug.

I should add that my scenarios are sometimes a bit wild, and would not necessarily reproduce in simple cases. Here, I had worked with two projects having the same classes in the same packages. I copied the classes between the projects into the matching package that I created beforehand.


I sometimes encounter secondary issues when I am trying to make a test case for a NetBeans bug. My brute force method of creating a test case is to take a copy of a large project with the bug in it. Then I close the original project and modify it until only the bug-relevant detail remains. Then after reporting the bug I have to re-open the original project. This approach has resulted in the reporting and fixing of a handful of secondary bugs.

In other scenarios such as this one, I created a new project with the matching package structure and copy some classes, hoping this will save me time. Of course I have to make a lot of modifications which reduces the chance of the bug remaining.

I think there are a lot of opportunities for things going wrong with breakpoints in these process.
Comment 10 Quality Engineering 2013-07-27 02:21:26 UTC
Integrated into 'main-silver', will be available in build *201307262300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d8cfb8833f56
User: mentlicher@netbeans.org
Log: Do not create duplicate breakpoint annotations, when breakpoint addition is fired later after we already created the annotation in a file. This was discovered during debugging issue #232670.
Comment 11 Martin Entlicher 2013-07-27 10:31:01 UTC
Thanks for the log files, I've found a lot of NPEs at
TypeRepository.getType(TypeRepository.java:143) there, thus I've submitted issue #233532 for this.

I've added removal of JSP breakpoints when the appropriate sources are deleted (like Java line breakpoints) and I've added additional test for submission of JSP breakpoints. Therefore it should fix this issue. I'll look then at what we can do about issue #226437.

http://hg.netbeans.org/core-main/rev/999d6a3f97ac
Comment 12 bht 2013-07-27 19:12:33 UTC
Thanks for your help. It's been a pleasure for me to work with you on this and see the progress.
Comment 13 Quality Engineering 2013-07-29 01:58:21 UTC
Integrated into 'main-silver', will be available in build *201307282300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/999d6a3f97ac
User: mentlicher@netbeans.org
Log: #232670: Remove JSP breakpoints when appropriate sources are deleted. Also test that JSP breakpoints are not created in non-JSP files.