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 218904 - Accessing file system in EDT: opening full remote file
Summary: Accessing file system in EDT: opening full remote file
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Remote (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks: 218138
  Show dependency tree
 
Reported: 2012-09-24 12:17 UTC by Egor Ushakov
Modified: 2013-05-13 16:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stacktrace (3.14 KB, text/plain)
2012-09-24 12:18 UTC, Egor Ushakov
Details
Here is some interesting statistics concerning FileObject attributes usage (36.26 KB, text/plain)
2012-10-31 13:45 UTC, Vladimir Kvashin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Egor Ushakov 2012-09-24 12:17:39 UTC
double click on any full remote file, during the opening we access file system from EDT, see attached stacktrace. Accessed file (.rfs_attr) is almost always absent.
Comment 1 Egor Ushakov 2012-09-24 12:18:40 UTC
Created attachment 124804 [details]
stacktrace
Comment 2 Vladimir Kvashin 2012-10-31 08:06:48 UTC
The calling line (DataObject.java:415) is

Object o = getPrimaryFile().getAttribute(PROP_TEMPLATE);
where PROP_TEMPLATE is a public constant;

this is called from DataObject.isTemplate method; if true returned, file is considered to be template, otherwise not.

Remote file object obviously can't be a template, since templates reside only in SystemFileSystem.

I think it's worth to hardcode well-known (in fact API) constants (e.g. "java.io.File") to remote file object getAttribute/setAttribute
Comment 3 Vladimir Kvashin 2012-10-31 13:45:23 UTC
Created attachment 126860 [details]
Here is some interesting statistics concerning FileObject attributes usage

this concerns only attributes that are not filtered out by remote file system
(which filters out, for example, "java.io.File" and some other attributes)
Comment 4 Vladimir Kvashin 2012-10-31 13:51:04 UTC
While thinking this issue over, I added some statistics concerning attributes that are not filtered out by remote file system ((which filters out, for example, "java.io.File" and some other attributes)

I created a full remote Quote, opened some files, invoked context menu several times, opened some other full remote projects. Here is statistics. Attached file also contains stacks


# name                   read-count   write-count

NetBeansAttrAssignedLoader 	309   0
OpenIDE-Folder-Order 		  4   0
OpenIDE-Folder-SortMode 	  2   0
remote.url 			255   0
template 			  5   6
org.netbeans.spi.project.AuxiliaryConfiguration.http://www.netbeans.org/ns/editor-bookmarks/1#editor-bookmarks 1   0
org.netbeans.spi.project.AuxiliaryConfiguration.http://www.netbeans.org/ns/editor-bookmarks/2#editor-bookmarks 1   0
org.netbeans.spi.project.AuxiliaryConfiguration.http://www.netbeans.org/ns/make-project-private/1#code-assistance-data 4   0
org.netbeans.spi.project.AuxiliaryConfiguration.http://www.netbeans.org/ns/projectui-open-files/1#open-files 3   0

The only attribute that is written is "template" and the reason is in o.n.m.cnd.source.SourceAbstractDataLoader, which first copies all attributes from template (including "template" attribute), then returns "template" attribute to false.
Comment 5 Quality Engineering 2012-11-01 02:45:28 UTC
Integrated into 'main-golden', will be available in build *201211010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1a22abfabefe
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: attributes usage statistics (related with issue #218904 - Accessing file system in EDT: opening full remote file)
Comment 6 Egor Ushakov 2013-05-13 16:22:45 UTC
I do not see this happening any more