Commit d273202
authored
Fix ConcurrentModificationException in getDeclaredResources and getResourcesFromProject (#1020)
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 93b0b9f commit d273202
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 | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
168 | 170 | | |
| 171 | + | |
169 | 172 | | |
170 | | - | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
239 | 243 | | |
| 244 | + | |
240 | 245 | | |
241 | | - | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
0 commit comments