arduino / arduino/Arduino

ConcurrentModificationException onUpdatePressed(LibraryManagerUI)

Open
#10,448 0 comments 3 reactions 0 assignees View on GitHub
Component: Board/Lib Manager Component: IDE Type: Bug
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

Hi! I'd like to report an issue (bug) with the Arduino IDE.
macOS 10.15.5
Arduino IDE 1.8.13 (Official build)

The issue can be reproduced with the following scenario.
On a freshly started Arduino IDE, I check for updatable packages, by opening Tools > Board: "..." > Boards Manager...
I wait to load, then I select Type Updatable. After this I click Close.
Then I open the Library Manager by clicking Sketch > Include Library > Manage Libraries...
While it loads, the below exception is thrown.

```
java.util.ConcurrentModificationException
java.lang.RuntimeException: java.util.ConcurrentModificationException
at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onUpdatePressed$2(LibraryManagerUI.java:207)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList.sort(ArrayList.java:1464)
at java.util.Collections.sort(Collections.java:177)
at cc.arduino.contributions.libraries.ui.LibrariesIndexTableModel.updateContributions(LibrariesIndexTableModel.java:208)
at cc.arduino.contributions.libraries.ui.LibrariesIndexTableModel.update(LibrariesIndexTableModel.java:138)
at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onUpdatePressed$2(LibraryManagerUI.java:204)
... 1 more
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the macOS Arduino IDE 1.8.13 sequence: check for updatable board packages, close Boards Manager, then open Library Manager while it loads. Start with LibraryManagerUI.java around lines 204-207 and LibrariesIndexTableModel.java around lines 138 and 208, then verify the sequence no longer throws ConcurrentModificationException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.