Commit d5d96f3
committed
Fix ConcurrentModificationException in getDeclaredResources and getResourcesFromProject
Add synchronized(syncResources) blocks around iterations in
getDeclaredResources() and getResourcesFromProject() to prevent
ConcurrentModificationException when the resources list is modified
concurrently by another thread.
Also changes both methods to iterate over this.resources directly
(inside the sync block) instead of this.getResources() which returns
an unprotected reference.
Fixes #9331 parent b069f1f commit d5d96f3
1 file changed
Lines changed: 15 additions & 11 deletions
Lines changed: 15 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
162 | 164 | | |
| 165 | + | |
163 | 166 | | |
164 | | - | |
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
| |||
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
233 | 237 | | |
| 238 | + | |
234 | 239 | | |
235 | | - | |
236 | 240 | | |
237 | 241 | | |
238 | 242 | | |
| |||
0 commit comments