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 58331 - MemoryFileSystem is fragile
Summary: MemoryFileSystem is fragile
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: rmatous
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2005-04-26 13:43 UTC by Jaroslav Tulach
Modified: 2008-12-22 23:38 UTC (History)
0 users

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 Jaroslav Tulach 2005-04-26 13:43:22 UTC
From time to time tests fail due to a problem in MemoryFileSystem. I am not 
quite sure, but I expect that if one calls: 
 
p = fo.getParent(); 
n = fo.getName(); 
fo.delete(); 
fo.isFolder(); // !!!! 
p.createFolder(n); 
 
then the sequence may fail sometime. The problem is likely that folder method 
calls e, which creates and registers the entry and then it is not possible to 
do the createFolder or rename, etc. 
 
  
      java.io.IOException: File already exists 
        at 
org.openide.filesystems.MemoryFileSystem.createData(MemoryFileSystem.java:141) 
        at 
org.openide.filesystems.AbstractFileObject.createData(AbstractFileObject.java:381) 
        at org.openide.filesystems.FileObject.createData(FileObject.java:599) 
        at 
org.openide.loaders.FolderInstanceTest.doTestListenersCount(FolderInstanceTest.java:134) 
        at 
org.openide.loaders.FolderInstanceTest.testListenersCountWithCookie(FolderInstanceTest.java:91) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at junit.framework.TestCase.runTest(TestCase.java:154) 
        at 
org.openide.loaders.FolderInstanceTest.runTest(FolderInstanceTest.java:72) 
        at org.netbeans.junit.NbTestCase.runBare(NbTestCase.java:136) 
        at junit.framework.TestResult$1.protect(TestResult.java:106) 
        at junit.framework.TestResult.runProtected(TestResult.java:124) 
        at junit.framework.TestResult.run(TestResult.java:109) 
        at junit.framework.TestCase.run(TestCase.java:118) 
        at org.netbeans.junit.NbTestCase.run(NbTestCase.java:123) 
        at junit.framework.TestSuite.runTest(TestSuite.java:208) 
        at junit.framework.TestSuite.run(TestSuite.java:203) 
        at 
org.netbeans.xtest.testrunner.JUnitTestRunner.runTests(JUnitTestRunner.java:176) 
        at 
org.netbeans.xtest.testrunner.JUnitTestRunner.runTests(JUnitTestRunner.java:127) 
        at 
org.netbeans.xtest.plugin.jvm.JUnitTestRunnerLauncher.main(JUnitTestRunnerLauncher.java:41)
Comment 1 Jaroslav Tulach 2005-04-27 10:56:35 UTC
I am not sure, but I think this failure is also related to the same problem: 
 
  
 
 
 
testOPermutationOfAlt: 
 
  
      java.lang.ClassNotFoundException: From file: 
AbstractFileObject@80f4cb[nbfs://nbhost/MemoryFileSystem/Shortcuts/OD-F6.instance] 
due to: java.lang.NullPointerException 
        at 
org.openide.loaders.InstanceSupport.instanceClass(InstanceSupport.java:143) 
        at 
org.openide.loaders.InstanceDataObject$Ser.instanceClass(InstanceDataObject.java:1121) 
        at 
org.openide.loaders.InstanceSupport.instanceCreate(InstanceSupport.java:197) 
        at 
org.openide.loaders.InstanceDataObject$Ser.instanceCreate(InstanceDataObject.java:1180) 
        at 
org.openide.loaders.InstanceDataObject.instanceCreate(InstanceDataObject.java:692) 
        at 
org.netbeans.core.ShortcutsFolder.acceptDataObject(ShortcutsFolder.java:128) 
        at 
org.openide.loaders.FolderInstance.defaultProcessObjects(FolderInstance.java:650) 
        at org.openide.loaders.FolderInstance.access$000
(FolderInstance.java:68) 
        at org.openide.loaders.FolderInstance$2.run(FolderInstance.java:622) 
        at org.openide.util.Task.run(Task.java:207) 
        at 
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:419) 
        at 
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:794) 
Comment 2 rmatous 2005-07-18 15:38:11 UTC
/cvs/openide/fs/src/org/openide/filesystems/MemoryFileSystem.java,v  <--  new
revision: 1.3; previous revision: 1.2

/cvs/openide/fs/test/unit/src/org/openide/filesystems/MemoryFSTestHid.java,v 
<--  initial revision: 1.1

/cvs/openide/fs/test/unit/src/org/openide/filesystems/MemoryFileSystemTest.java,v
 new revision: 1.2; previous revision: 1.1
Comment 3 rmatous 2005-07-18 16:42:20 UTC
Reopened, fix must be improved. 
Comment 4 rmatous 2005-07-20 12:56:55 UTC
Fixed.
/cvs/openide/fs/src/org/openide/filesystems/MemoryFileSystem.java,v  <--  new
revision: 1.5; previous revision: 1.4

/cvs/openide/fs/test/unit/src/org/openide/filesystems/MemoryFileSystemTest.java,v
 new revision: 1.4; previous revision: 1.3