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 241999 - java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry
Summary: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.n...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Maria Tishkova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-17 11:10 UTC by Vladimir Voskresensky
Modified: 2014-02-18 03:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 207684


Attachments
stacktrace (2.59 KB, text/plain)
2014-02-17 11:10 UTC, Vladimir Voskresensky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2014-02-17 11:10:45 UTC
Build: NetBeans IDE Dev (Build 20140217-1fe308be131c)
VM: Java HotSpot(TM) Server VM, 24.51-b03, Java(TM) SE Runtime Environment, 1.7.0_51-b13
OS: SunOS

User Comments:
vv159170: opened cc project




Stacktrace: 
java.util.ConcurrentModificationException
   at java.util.HashMap$HashIterator.nextEntry(HashMap.java:926)
   at java.util.HashMap$EntryIterator.next(HashMap.java:966)
   at java.util.HashMap$EntryIterator.next(HashMap.java:964)
   at org.netbeans.modules.cnd.repository.storage.UnitDescriptorsDictionary.getUnitDescriptor(UnitDescriptorsDictionary.java:87)
   at org.netbeans.modules.cnd.repository.storage.Storage.getUnitName(Storage.java:588)
   at org.netbeans.modules.cnd.repository.storage.StorageManager.getUnitName(StorageManager.java:265)
Comment 1 Vladimir Voskresensky 2014-02-17 11:10:49 UTC
Created attachment 145298 [details]
stacktrace
Comment 2 Maria Tishkova 2014-02-17 13:52:34 UTC
race condition: if we delete filepaths dictionary from the map even if we put it to the writer queue it can be updated before storing to disk and therefore the content will be broken
Introduced new method flush() for Storage and StorageManager which will be invoked on shutdown and it will put file paths dictionaries to the writer queue 

fixed in http://hg.netbeans.org/cnd-main/rev/65229ec80efc
Comment 3 Quality Engineering 2014-02-18 03:15:03 UTC
Integrated into 'main-silver', will be available in build *201402180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/65229ec80efc
User: Maria Dalmatova <mromashova@netbeans.org>
Log: fixed bz#241990 - Exception: Path should be absolute: <WRONG FILE> and bz#241999 - java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry
race condition: if we delete filepaths dictionary from the map even if we put it to the writer  queue it can be updated before storing to disk and therefore the content will be broken
Introduced new method flush() for Storage and StorageManager which will be invoked on shutdown and it will put file paths dictionaries to the writer queue