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 271819

Summary: FileSystem does not deliver all ChangeEvents for outside changes
Product: platform Reporter: Tristan
Component: FilesystemsAssignee: Jaroslav Havlin <jhavlin>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: ZIP of maven project with simple test

Description Tristan 2017-11-16 10:43:04 UTC
Created attachment 165459 [details]
ZIP of maven project with simple test

In our Netbeans RCP application we use the filesystem API.
Our test shown that the method "fileChanged" of a FileChangeAdapter is not called for every change we make outside the filesystem. The detection is triggered by calling "fs.refresh(false);"

We think that a file change event can be garbage collected before it is delivered. That explains why simple tests work perfectly, but the system fails at runtime with more pressure on the heap.

We attached a Minimal, Complete, and Verifiable example project. It simulates file changes inside a MemoryFileSystem via setting the lastModified field, calls refresh and checks the corresponding amount of delivered events. Mostly the test does not pass.

A second test tries the same but also holds a strong ref to the file object. That test passes more frequently.