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.
Product Version = NetBeans IDE Dev (Build 20110711-19a9d9a0205b) Operating System = Linux version 2.6.37.6-0.5-desktop running on amd64 Java; VM; Vendor = 1.6.0_26 Runtime = Java HotSpot(TM) 64-Bit Server VM 20.1-b02 Since the fix for #198665 our tests (in versioning) started failing occasionally. After a long digging and debugging NbPreferences' code i came across a probable cause. If i understand correctly, modifying prefs comes in the following steps: 1) value is stored in memory in a map of properties 2) an async task is run after 200 ms that takes the map and persists it on disk in a preferences file 3) at the end of the async task FS fires a fileChanged event that results in calling NbPreferences.stateChanged method that empties the whole property map kept in memory Now what happens when someone calls NbPreferences.put(...) right between 2) and 3)? Unless i am mistaken, the change is not stored and instead dropped into a black hole. I'll attaching a test demonstrating the problem (but it's an artificial one). Hard to say if this may affect something other than unit tests, but you should definitely at least know about this.
Created attachment 109421 [details] test
maybe something like this could help, although it's probably not a 100% bulletproof fix
Created attachment 109422 [details] a simple fix
Thank you, Ondrej. Will be fixed together with #198665 and #197594 .
This should be fixed now. See 197594#c40