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 17246 - Utilities should not use TopManager
Summary: Utilities should not use TopManager
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: Sun SunOS
: P4 blocker (vote)
Assignee: phamernik
URL:
Keywords:
Depends on: 17363
Blocks:
  Show dependency tree
 
Reported: 2001-11-02 11:26 UTC by Jan Zajicek
Modified: 2008-12-23 00:05 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
FTD (17.44 KB, text/plain)
2001-11-02 11:27 UTC, Jan Zajicek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Zajicek 2001-11-02 11:26:08 UTC
See attached thread dump.
Comment 1 Jan Zajicek 2001-11-02 11:27:42 UTC
Created attachment 3245 [details]
FTD
Comment 2 phamernik 2001-11-07 09:32:00 UTC
The deadlock happened during reading FileSystems XML attributes.

The recent change in openide.util.Utilities (1.70 - bugfix of #17164) 
caused that AWT-EventQueue thread went through 
- reading (deserialization) of XML attributes (synchronized method)
- Utilities.translate
- Utilities.getSystemClassLoader
- and finally waited for Folder recognizer thread

The Folder Recognizer thread was waiting for reading XML attributes 
and so never ended.

The problem was fixed by reverting the change 1.70 in Utilities (see 
revision 1.72).

Comment 3 _ pkuzel 2001-11-07 09:54:38 UTC
In fact I did not reverted Lookup usage as it was required by Yarda.
TopManager is forbidden in Utilities however it was used in previous
version. Going to use TopManager again.

Created http://openide.netbeans.org/issues/show_bug.cgi?id=17363
Comment 4 _ pkuzel 2001-11-07 09:59:40 UTC
Utilities (see revision 1.73)
Comment 5 Jaroslav Tulach 2001-11-08 15:00:16 UTC
In which previous version? If you really need, code it with
reflection, but do not break whole usage of utilities just because of
this.
Comment 6 phamernik 2001-11-08 15:39:50 UTC
Petr Kuzel is working on this. Reassigning to Petr K.
Comment 7 _ pkuzel 2001-11-08 16:53:33 UTC
Look at 1.69 there was really used TopManager. Just you, Yarda, warned
me not to use it there (see #17431), but it does not work without it.
Anyway you are right application platform will require to distingvish.

May be, Jesse suggested to use a startup class loader (I do not know
nothing like it, is it a core private classloader?) to solve it. So I
can proceed with Utilities.class.getClassLoader() however it sounds to
me like a functionality by a chance.

I do not buy your suggestion to use reflection to reach TopManager.

I need to get to the system class loader in clean way. <sorry>Do I ask
a lot?</sorry>

I see the problem with allInstances() as Lookup.getDefault() is the
composite lookup and must also wait for FolderLookup in spite of the
fact that the result is known from TMLookup that is the first in the
composite. If it is not implementation dependent I can switch all
blocking calls that must return Lookup results to simple:

  Lookup.getDefault().lookup(ClassLoader.class)

I suppose it returns the first result so it will never wait for the
FolderLookup.
Comment 8 _ pkuzel 2001-11-13 14:38:27 UTC
Resolved in Utilities 1.74.
Comment 9 Jaroslav Tulach 2001-11-14 13:57:11 UTC
Ok, but there is a small difference between
TopManager.systemClassLoader () and Lookup.lookup (ClassLoader.class)
I forgot to mention - the later can return null. The code does not
seem to be ready for that.
Comment 10 Quality Engineering 2003-07-01 16:03:11 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified
Comment 11 Quality Engineering 2003-07-01 16:23:02 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.