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 - FileSystem does not deliver all ChangeEvents for outside changes
Summary: FileSystem does not deliver all ChangeEvents for outside changes
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 8.2
Hardware: PC Linux
: P2 normal (vote)
Assignee: Jaroslav Havlin
Depends on:
Reported: 2017-11-16 10:43 UTC by Tristan
Modified: 2017-11-16 10:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

ZIP of maven project with simple test (17.58 KB, application/zip)
2017-11-16 10:43 UTC, Tristan

Note You need to log in before you can comment on or make changes to this bug.
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.