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 196914 - New file doesn't appear in "C/C++ Project with Existing Sources" project
Summary: New file doesn't appear in "C/C++ Project with Existing Sources" project
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.0
Hardware: PC Solaris
: P1 normal (vote)
Assignee: Jaroslav Tulach
Depends on: 190462
Blocks: 26230
  Show dependency tree
Reported: 2011-03-21 11:36 UTC by soldatov
Modified: 2011-04-21 19:52 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

test case (350.00 KB, application/x-tar)
2011-03-23 13:22 UTC, Vladimir Voskresensky

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2011-03-21 11:36:51 UTC
This scenario worked nicely in Oracle Solaris Studio build 16.0, but it fails in build 17.0 or NetBeans 7.0RC1.

- Launch IDE on Solaris 10 (I think RedHat 5 has same problem too)
- Create "C/C++ Project with Existing Sources" project
- Expand some node in Projects tab
- Create test.txt file in some external terminal (gnome terminal)
- Wait test.txt in Projects tab
==> files doesn't appear

In Solaris Express new file appears. On everest (Solaris 10) files doesn't appear
Comment 1 Vladimir Voskresensky 2011-03-21 12:12:38 UTC
Sasha, could it be side effect of using addRecursiveListener on systems without native support for native listeners? (Solaris 11 has such support, while Solaris 10 not)
Comment 2 Alexander Pepin 2011-03-22 17:54:46 UTC
It's working properly on Ubuntu and fails on Solaris 10.
Comment 3 Vladimir Voskresensky 2011-03-23 12:53:54 UTC
(In reply to comment #0)
> This scenario worked nicely in Oracle Solaris Studio build 16.0, but it fails
> in build 17.0 or NetBeans 7.0RC1.
My assumption is: it's caused by migration from "listener per folder" to recursive listener per source root.

It is 100% reproducible on system without fs native support (or with turned off native listeners -J-Dorg.netbeans.modules.masterfs.watcher.disable=true)
It's asymmetrical behavior of NB FileSystem events.
externally created file does not appear in "Project"/"Files"/"Favorites" views at all.

Other investigation on systems without native listeners (or listeners OFF) shows:
- if I add /var/tmp/folder to favorites and externally create file in /var/tmp/folder => Favorites is updated after focus gained
- but if I add to favorites folder which is under recursive listening (i.e. source folder of usual project) => externally created file never appears neither in Favorites nor in Projects/Files views

Please, evaluate.
Comment 4 Vladimir Voskresensky 2011-03-23 13:21:22 UTC
please find attached test to reproduce the issue easier:
unpack attached archive => you'll have "testcase" folder

- run IDE with -J-Dorg.netbeans.modules.masterfs.watcher.disable=true
- add to Favorites "testcase" folder
- expand tescase/Quote_9 folder
- externally create file tescase/Quote_9/file.c
- switch to IDE and observe that after delay file.c appears in Favorites view
- open project testcase/quote_9_1
-- make sure that file.c is visible in Project and Files view under "Quote_9" folder
- externally create file tescase/Quote_9/file2.c and switch back to IDE
=> file2.c is not visible in any of views (projects/files/favorites)

One more strange thing:
- if close project => exception appears
Comment 5 Vladimir Voskresensky 2011-03-23 13:22:34 UTC
Created attachment 107219 [details]
test case

project to reproduce issue with recursive listeners on systems without native file liesteners support
Comment 6 Jaroslav Tulach 2011-03-24 06:04:34 UTC
Probably connected to bug 190462 or directly problem of bug 26230
Comment 7 Jaroslav Tulach 2011-03-24 07:02:02 UTC
ergonomics#19ceb32e9a7d (feel free to hg pull -r 19ceb32e9a7d to test the change before it propagates).
Comment 8 Vladimir Voskresensky 2011-03-24 10:59:56 UTC
looks like caused tests failures
Comment 9 Jaroslav Tulach 2011-03-24 12:15:44 UTC
1. everything works locally. It is going to be tough to find out where the problem is.
2. still, please verify the fix in real field
3. in case the test continues to fail, it is possible to comment out the assert for a while
4. next week I am on vactation - e.g. unlikely I will backport the fix myself.
Comment 10 Jaroslav Tulach 2011-03-24 14:42:32 UTC
Was broken, because deadlock does not support native listeners. I needed to disable the test in such case: ergonomics#deb68c4fd6e6
Comment 11 Vladimir Voskresensky 2011-03-24 18:36:47 UTC
Jarda, the bug was *exactly* about systems without native listeners support. How test written for such case can be broken on system  without native listeners support???
Comment 12 Jaroslav Tulach 2011-03-25 05:16:38 UTC
When there is a addRecursiveListener(dir), then the manual refresh skips files under dir on systems that support native listeners. That is what the test checks. But the test needs to be disabled on system that don't support native listeners (as in such case recursive listeners don't prevent manual refreshes).
Comment 13 Vladimir Voskresensky 2011-03-25 12:07:53 UTC
verified in cnd-main
Comment 14 Vladimir Voskresensky 2011-03-26 20:13:55 UTC
Please, integrate into release70
Comment 15 Vladimir Kvashin 2011-03-29 20:03:26 UTC
Transplanted into releases (branch release70):
Comment 16 Tomas Danek 2011-04-01 09:08:03 UTC
could you please verify also in 7.0 post rc1 build and mark as verified? thanks in advance