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.
Summary: | Possible ConcurrentModificationException in KeymapModel.getActionCategories() | ||
---|---|---|---|
Product: | editor | Reporter: | fvogler <fvogler> |
Component: | Key bindings | Assignee: | David Strupl <dstrupl> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jskrivanek, mklaehn, sreimers |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Make KeymapModel.getActionCategories() thread safe |
I will have a look at this. I will not apply the patch as is since calling Lookup.getDefault().lookupAll(KeymapManager.class) while holding any kind of lock is rather dangerous (because it can block). I will try to solve the exception differently. BTW calling org.netbeans.modules.options.keymap.KeymapPanel.<init>(KeymapPanel.java:94) not from AWT EDT is rather wrong since it is a swing call ... Changeset: 2a96468ccd85 Author: David Strupl <dstrupl@netbeans.org> Date: 2009-12-15 15:18 Message: KeymapModel.getKeymapManagerInstances() synchronized Issue #178294 - Possible ConcurrentModificationException in KeymapModel.getActionCategories() The fix is almost the same as the original patch - thanks. I have just made the synchronized section smaller ... Integrated into 'main-golden', will be available in build *200912161400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2a96468ccd85 User: David Strupl <dstrupl@netbeans.org> Log: KeymapModel.getKeymapManagerInstances() synchronized Issue #178294 - Possible ConcurrentModificationException in KeymapModel.getActionCategories() |
Created attachment 92270 [details] Make KeymapModel.getActionCategories() thread safe Lazy initialization in org.netbeans.modules.options.keymap.KeymapModel.getActionCategories() is not thread safe. java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at org.netbeans.modules.options.keymap.KeymapModel.getActionCategories(KeymapModel.java:96) at org.netbeans.modules.options.keymap.KeymapModel.<init>(KeymapModel.java:445) at org.netbeans.modules.options.keymap.KeymapViewModel.<init>(KeymapViewModel.java:84) at org.netbeans.modules.options.keymap.KeymapPanel.getModel(KeymapPanel.java:227) at org.netbeans.modules.options.keymap.KeymapPanel.<init>(KeymapPanel.java:94) at org.netbeans.modules.options.keymap.KeymapPanelController.getKeymapPanel(KeymapPanelController.java:106) at org.netbeans.modules.options.keymap.KeymapPanelController.getLookup(KeymapPanelController.java:86) at org.netbeans.modules.options.CategoryModel$Category.getLookup(CategoryModel.java:431) at org.netbeans.modules.options.CategoryModel$Category.access$000(CategoryModel.java:313) at org.netbeans.modules.options.CategoryModel$1.run(CategoryModel.java:93) Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:694) at org.netbeans.modules.options.CategoryModel$2.run(CategoryModel.java:115) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:641) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1123)