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 138287 - Netbeans should indicate whether thread is daemon or not
Summary: Netbeans should indicate whether thread is daemon or not
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@debugger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-25 22:25 UTC by _ gtzabari
Modified: 2009-01-12 17:16 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2008-06-25 22:25:13 UTC
We need the "Threads" debugger tab to indicate whether a thread is daemon or not in order to figure out what threads are
preventing the application from shutting down.
Comment 1 Martin Entlicher 2008-06-26 08:40:14 UTC
This will most probably not be implemented, unless appropriate method is added into JDI API.
Currently there is no way, through JDI to find out whether a thread is daemon or not. Thus the only way to retrieve that
information is to call Thread.isDaemon(). But methods can be called only when a thread is suspended by an event - e.g.
breakpoint event.
Comment 2 _ gtzabari 2008-06-26 08:41:41 UTC
mentlicher,

I'm only expecting to see this information when threads are suspended, such as when a breakpoint is hit or a developer
hits the pause button.
Comment 3 Martin Entlicher 2008-06-26 08:49:10 UTC
If you hit pause, we can not invoke any methods. The suspension has to come from a registered event - breakpoint, step,
etc. That's a limitation of JDI. It seems to me that this behavior is too limiting for this feature.
Comment 4 _ gtzabari 2008-06-26 10:31:03 UTC
I'm confused. When I click on pause, I can then go into the "watch" window and execute
"Thread.currentThread().isDaemon()". Why can't Netbeans do the same automatically under the hood?
Comment 5 _ gtzabari 2008-09-11 23:05:27 UTC
BTW, if we need a JDK change I'd like to file a RFE with Sun but I don't understand the problem as well as you. Is it
possible for you to file a RFE yourself or provide me with enough information to do so?
Comment 6 _ gtzabari 2008-12-09 22:06:14 UTC
mentlicher,

Is implementing http://bugs.sun.com/view_bug.do?bug_id=6588467 sufficient for this bug or do you need something else?
I'd like to file a new RFE report if this one doesn't cover your requirements.
Comment 7 Martin Entlicher 2009-01-12 17:16:45 UTC
Well, in fact, I need http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799761.

There's a workaround - to fetch java.lang.Thread.daemon field, but that field is private, can be changed at any time and
e.g. IBM's JDK have java.lang.Thread.isDaemon field.
Method calls are not allowed e.g.on KVM (J2ME) and can be performed only in threads suspended by an event - not
something we want do often and automatically.