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 46701

Summary: Repository.getDefaultFileSystem() may not be writeable
Product: platform Reporter: Jaroslav Tulach <jtulach>
Component: FilesystemsAssignee: Jaroslav Tulach <jtulach>
Status: CLOSED FIXED    
Severity: blocker CC: dstrupl, jglick, rmatous
Priority: P3 Keywords: API_REVIEW_FAST
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: The changes

Description Jaroslav Tulach 2004-07-28 14:34:03 UTC
When running in unit tests, without core.jar in
classpath the default repository returned from
Repository.getDefault() creates default filesystem
as XMLFileSystem. 

As a result tests need to do complicated setups to
be able to write to default filesystem and/or
sometimes use core.jar just to get the write
permition.

The proposal changes the
Repository.getDefaultFileSystem() to be in memory
only fully featured filesystem. As this impl used
to be in core, it adds new method
FileUtil.createMemoryFileSystem so core can get
its own instance when it needs it.
Comment 1 Jaroslav Tulach 2004-07-28 14:34:37 UTC
Created attachment 16522 [details]
The changes
Comment 2 Jaroslav Tulach 2004-07-28 14:36:01 UTC
Reviewers, please comment.
Comment 3 Jesse Glick 2004-07-28 16:43:59 UTC
Looks OK to me.
Comment 4 David Strupl 2004-07-29 00:27:49 UTC
The changes look fine to me. Do all the tests pass for you? I did not
try them now (in trunk) but there were couple of failures for me in
the past (in 3.6). 
Comment 5 Jaroslav Tulach 2004-07-29 06:51:12 UTC
There was one line mistake during rename. I've fixed it and now all
the tests pass. So the MemoryFS in diff is not completely same as the
memory fs in current core trunk.
Comment 6 Jaroslav Tulach 2004-08-03 12:27:12 UTC
Ok, will be integrated.
Comment 7 Jaroslav Tulach 2004-08-04 10:17:59 UTC
grep Index: X.diff | grep -v ExplorerPanelTest | cut -c 8-
core/src/org/netbeans/core/projects/MemoryFileSystem.java
core/src/org/netbeans/core/projects/SystemFileSystem.java
openide/openide-spec-vers.properties
openide/api/doc/changes/apichanges.xml
openide/src/org/openide/filesystems/ExternalUtil.java
openide/src/org/openide/filesystems/FileUtil.java
openide/src/org/openide/filesystems/MemoryFileSystem.java
~/work$ grep Index: X.diff | grep -v ExplorerPanelTest | cut -c 8- |
xargs cvs ci -m "#46701: Factory for creation of writeable memory file
system"
Removing core/src/org/netbeans/core/projects/MemoryFileSystem.java;
/cvs/core/src/org/netbeans/core/projects/MemoryFileSystem.java,v  <--
 MemoryFileSystem.java
new revision: delete; previous revision: 1.8
done
Checking in core/src/org/netbeans/core/projects/SystemFileSystem.java;
/cvs/core/src/org/netbeans/core/projects/SystemFileSystem.java,v  <--
 SystemFileSystem.java
new revision: 1.42; previous revision: 1.41
done
Processing log script arguments...
More commits to come...
Checking in openide/openide-spec-vers.properties;
/cvs/openide/openide-spec-vers.properties,v  <-- 
openide-spec-vers.properties
new revision: 1.153; previous revision: 1.152
done
Processing log script arguments...
More commits to come...
Checking in openide/api/doc/changes/apichanges.xml;
/cvs/openide/api/doc/changes/apichanges.xml,v  <--  apichanges.xml
new revision: 1.213; previous revision: 1.212
done
Processing log script arguments...
More commits to come...
Checking in openide/src/org/openide/filesystems/ExternalUtil.java;
/cvs/openide/src/org/openide/filesystems/ExternalUtil.java,v  <-- 
ExternalUtil.java
new revision: 1.8; previous revision: 1.7
done
Checking in openide/src/org/openide/filesystems/FileUtil.java;
/cvs/openide/src/org/openide/filesystems/FileUtil.java,v  <-- 
FileUtil.java
new revision: 1.107; previous revision: 1.106
done
RCS file: /cvs/openide/src/org/openide/filesystems/MemoryFileSystem.java,v
done
Checking in openide/src/org/openide/filesystems/MemoryFileSystem.java;
/cvs/openide/src/org/openide/filesystems/MemoryFileSystem.java,v  <--
 MemoryFileSystem.java
initial revision: 1.1
Comment 8 Jaromir Uhrik 2005-07-14 16:19:32 UTC
Verified.