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 18334 - Add threading info to method descriptions.
Summary: Add threading info to method descriptions.
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 20276 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-12-04 13:24 UTC by Milos Kleint
Modified: 2008-12-22 09:49 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Kleint 2001-12-04 13:24:25 UTC
I've experienced a few times that I called a wrong openide method in different
places of my code that created deadlocks or other hard to trace problems. (some
worked for some time but failed in the long run)
The reason was that I used the methods on wrong places. (since I didn't
know/care about what is exactly done inside)

Examples:
use for FileObject.refresh()/findResource() within the
AbstractFileSystem.info/change/children interface..
time consuming dataobject/fileobject methods within a propertychangelistener
that  were creating cycles and potentially deadlocks.

It would be nice if time/performance critical methods were given a javadoc
description with a warning (and maybe possible solution). 
Or a preffered thread for a method's call..
Comment 1 Jesse Glick 2001-12-04 17:26:46 UTC
You've read the Threading Document in the APIs, right?

There is surely more to say. Unfortunately I don't know what the
answers are.
Comment 2 Jesse Glick 2001-12-12 22:10:47 UTC
Didn't get a response here, will assume you read it and it makes
(some) sense. This document lists generally which thread or threading
scheme should be used for entire APIs, rather than individual methods
(with just a couple of exceptions). I would say *any* filesystems
method should be considered performance-critical unless there is some
reason to think otherwise, and the doc says so.

Could you elaborate your sentence about PCL's and refresh and AFS
interfaces and DataSystems methods? I don't really follow what you are
saying there.
Comment 3 Milos Kleint 2001-12-13 08:25:25 UTC
yes, I've read it.. It's a nice start. However I haven't seen the
threading info in the javadoc itself.. It's te Threadng document is
nice reading but for everyday use it's not of much use: Example:
DataObject.getChildren() is considered bad under some circumstance in
the Threading document, however the javadoc states just:
"Get the children of this folder.". And the Javadoc is the place to go
with everyday use, I don't check all the different documents on the
openide site when programming.

Another example that might be more explanatory:

Just lately I've been told that SharedClassObject.findObject() when
searching for Global settings can be quite time consuming.. I don't
know, so I'm happily calling the method to find out a global setting's
value in the FileSystem.Change.outputStream() method.
What I would like to see is a small comment in the javadoc. "Do not
use in the performance extensive code segments".

Comment 4 Jaroslav Tulach 2002-01-07 08:49:55 UTC
The example with DataFolder is good one, but for oposite reasons.

As far as I know the DataFolder.getChildren () is safe for everyone
except for those who provide underlaying layers: lookup & filesystems

There is much more people writing something safe than those who write
lookup&fss...

So should the JavaDoc scare those people and be accurate or people
should remember that is is dangerous to call from lower layer to upper
layer of the system (layers are: lookup, filesystem, datasystem,
nodes...)?
Comment 5 Jesse Glick 2002-02-07 17:11:36 UTC
*** Issue 20276 has been marked as a duplicate of this issue. ***
Comment 6 Jesse Glick 2008-11-05 20:43:12 UTC
I guess obsolete now. If anyone knows what is or is not legal, document it.