| Summary: | ConcurrentModificationException in StorableCdtVariables | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Sluvy Mising name <SlavyTest> | ||||||
| Component: | cdt-core | Assignee: | Andrew Gvozdev <angvoz.dev> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | Andrew Gvozdev <angvoz.dev> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | marc.khouzam, veaceslav.bacu, yevshif | ||||||
| Version: | 8.0 | Flags: | angvoz.dev:
review+
|
||||||
| Target Milestone: | 8.2 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Can you submit a patch fixing the issue? See http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_submit_a_fix_for_a_bug.3F Created attachment 217229 [details]
Fix for 348884 including unit test
Fix for 348884 - Linear implementation for the fix.
Added unit test as well.
Created attachment 217462 [details]
Fix for 348884 including unit test
Attached a fix and a unit test for this bug
(In reply to comment #3) > Created attachment 217462 [details] > Fix for 348884 including unit test > Attached a fix and a unit test for this bug Committed to master with minor addition. Thanks for the patch. *** cdt git genie on behalf of Andrew Gvozdev ***
bug 348884: ConcurrentModificationException in StorableCdtVariables
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=aa4abe428dee9287bacdcd16abad56ddf140e627
*** cdt git genie on behalf of Veaceslav Bacu ***
bug 348884: ConcurrentModificationException in StorableCdtVariables
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=582b358f0fda6d028ee50f92774c1db7cfa33897
*** cdt git genie on behalf of Andrew Gvozdev ***
bug 348884: Fixed unit test
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=c7438e07089a969d8ddb6f69431369d43b5ad4a7
|
Build Identifier: 20100917-0705 Trivial exception encountered trying to remove 2(or more, but not all) variables and then clicking the Apply button MESSAGE Internal error !STACK 0 java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) at java.util.HashMap$ValueIterator.next(Unknown Source) at org.eclipse.cdt.internal.core.cdtvariables.StorableCdtVariables.setMacros(StorableCdtVariables.java:185) at org.eclipse.cdt.internal.core.cdtvariables.UserDefinedVariableSupplier.setMacros(UserDefinedVariableSupplier.java:267) at org.eclipse.cdt.internal.core.cdtvariables.UserVarSupplier.setMacros(UserVarSupplier.java:82) at org.eclipse.cdt.managedbuilder.ui.properties.CPropertyVarsTab.performApply(CPropertyVarsTab.java:654) at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.handleTabEvent(AbstractCPropertyTab.java:521) at org.eclipse.cdt.ui.newui.AbstractPage.forEach(AbstractPage.java:1018) at org.eclipse.cdt.ui.newui.AbstractPage$5.run(AbstractPage.java:646) at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) Reproducible: Always Steps to Reproduce: 1. Make sure you have a C or C++ project 2. Open project properties 3. Go to C/C++ Build -> Build Variables -> and add 3 or more variables 4. Click Apply 5. Delete 2 or more variables, but make sure you don't delete all of them 6. Click Apply 7. Notice Internal Error: java.util.ConcurrentModificationException 8. Check the log file: MESSAGE Internal error !STACK 0 java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) at java.util.HashMap$ValueIterator.next(Unknown Source) at org.eclipse.cdt.internal.core.cdtvariables.StorableCdtVariables.setMacros(StorableCdtVariables.java:185) at org.eclipse.cdt.internal.core.cdtvariables.UserDefinedVariableSupplier.setMacros(UserDefinedVariableSupplier.java:267) at org.eclipse.cdt.internal.core.cdtvariables.UserVarSupplier.setMacros(UserVarSupplier.java:82) at org.eclipse.cdt.managedbuilder.ui.properties.CPropertyVarsTab.performApply(CPropertyVarsTab.java:654) at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.handleTabEvent(AbstractCPropertyTab.java:521) at org.eclipse.cdt.ui.newui.AbstractPage.forEach(AbstractPage.java:1018) at org.eclipse.cdt.ui.newui.AbstractPage$5.run(AbstractPage.java:646) at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:69) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) 9. Check StorableCdtVariables.setMacros for (ICdtVariable m : getMap().values()){ int i; for(i = 0 ; i < macros.length; i++){ if(m.getName().equals(macros[i].getName())) break; } if(i == macros.length) deleteMacro(m.getName()); } Notice the trivial oversight: iterating over a collection which gets modified