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 212592 - BuildListener.buildFinished() is not called, when the build finishes.
Summary: BuildListener.buildFinished() is not called, when the build finishes.
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-16 14:34 UTC by Martin Entlicher
Modified: 2012-05-19 09:55 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 Martin Entlicher 2012-05-16 14:34:25 UTC
See issue #212286.
When debugger is attaching to Paint Application, in JPDAStart.run(), we add BuildListener to getProject(). But after the application finishes it's execution, the BuildListener.buildFinished() method is not called.
This method is called correctly, when debugging Java project.

To reproduce, run NetBeans with -J-Dorg.netbeans.modules.debugger.jpda.ant.level=400
When you debug AnagrameGame and exit the application, you get following messages:
FINE [org.netbeans.modules.debugger.jpda.ant]: buildFinished: waiting for listening start...
FINE [org.netbeans.modules.debugger.jpda.ant]: buildFinished: stopping listening...
FINE [org.netbeans.modules.debugger.jpda.ant]: buildFinished: interrupting listening thread...
FINE [org.netbeans.modules.debugger.jpda.ant]: buildFinished: listening thread = null
FINE [org.netbeans.modules.debugger.jpda.ant]: buildFinished: killing session org.netbeans.api.debugger.Session localhost:com.toy.anagrams.ui.Anagrams

But when debugging Paint Application, you get no such messages after debugging is finished.
Comment 1 Jesse Glick 2012-05-18 01:48:01 UTC
Correct, because you are adding a listener to a subproject (cf. Ant.init and Project.createSubProject), and only the initiating project will fire a build finish event.

This logic seems suspect anyway. What if the script calls <jpdastart>, runs a <java fork="true"> program with that debug port, and then begins a four-hour download? Probably you want to pay attention to the actual task during which the debugger server is contacted, and clean up when that task completes (perhaps using an AntLogger).
Comment 2 Martin Entlicher 2012-05-18 15:42:30 UTC
It's strange that the build listener does not work for the suite project "PaintApp", nor for the project itself "PaintApp/Paint".

So perhaps <jpdastart> should accept a task name it will wait for. And after that task is done, it will stop listening.
Comment 3 Quality Engineering 2012-05-19 09:55:19 UTC
Integrated into 'main-golden', will be available in build *201205190400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/651970696a1b
User: Jesse Glick <jglick@netbeans.org>
Log: Additional logging for #212592.