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 44057 - Empty dir var/ getting created by unit tests
Summary: Empty dir var/ getting created by unit tests
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: rmatous
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2004-05-31 16:19 UTC by Jesse Glick
Modified: 2008-12-22 23:14 UTC (History)
1 user (show)

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 Jesse Glick 2004-05-31 16:19:39 UTC
I have /space/src/nb_all mounted as a CVS
filesystem. I have noticed recently that the
directory /space/src/nb_all/var/attributes/ keeps
getting created (it is empty) even after I delete it.
Comment 1 Martin Entlicher 2004-06-09 15:11:11 UTC
I do not have "attributes" String in VCS modules that could cause
this. Isn't this created by masterFS?
Comment 2 rmatous 2004-06-09 15:51:07 UTC
MasterFS creates folloeing file new File(userDir, "var"). 

I didn't notice something like that. Is this still actual ? 
Comment 3 Jesse Glick 2004-06-09 20:08:26 UTC
Don't see it at the moment. Not sure how to reproduce - what causes
it. Perhaps you are not checking for a null user dir? Remember that
inside a unit test, netbeans.user will generally not be set.
Comment 4 Jesse Glick 2004-06-11 23:38:02 UTC
Just happened to me again - noticed a dir
/space/src/ant_loggers_42525/ant/var/ (with a timestamp about fifteen
minutes old) when I did a cvs update in .../ant/ after having run a
bunch of unit tests etc. for a while. I cannot reproduce what causes
the directory to be created, though, if I delete it.

I seem to have a ~/var/ too, about a week old, empty.

Aha, now I see my suspicion was correct. In
o.n.m.masterfs.providers.Attributes.getRootForAttributes:

String userDir = System.getProperty(USERDIR);
rootForAttributes = new File(userDir, LOCATION);
if (!rootForAttributes.exists()) {
    rootForAttributes.mkdirs();
}

Clearly if you are running a unit test or some other standalone lib
and ${netbeans.user} is not set, this will create an empty directory
called ${user.dir}/var.

You need to disable global attr read/write to disk when
${netbeans.user} is not set.
Comment 5 rmatous 2004-06-17 15:36:40 UTC
/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/ExLocalFileSystem.java
new revision: 1.3; previous revision: 1.2

/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/providers/Attributes.java
new revision: 1.5; previous revision: 1.4
Comment 6 Marian Mirilovic 2005-12-20 15:45:59 UTC
This issue was solved long time ago. Because nobody has reopened it neither
added comments, we are verifying/closing it now. 
If you are still able to reproduce the problem, please reopen. Thanks in advance.