Fix ConcurrentModificationException in CompletionProvider listener iteration#13
Merged
ethanyhou merged 2 commits intoApr 20, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/microsoft/copilot-for-eclipse/sessions/cfbb6b26-8dc6-4785-9757-96c98224c352 Co-authored-by: jdneo <6193897+jdneo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix internal error during completion generation in Copilot plugin
Fix ConcurrentModificationException in CompletionProvider listener iteration
Apr 18, 2026
jdneo
approved these changes
Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CompletionProvider.notifyCompletionResolvediteratescompletionListenerson the completion job worker thread, whileaddCompletionListener/removeCompletionListenercan mutate the set from other threads. Backing it with a plainLinkedHashSetproduced theConcurrentModificationExceptionreported in the issue:Changes
CompletionProvider.java: switchcompletionListenersfromLinkedHashSettoCopyOnWriteArraySet. Iteration is snapshot-based and safe under concurrent add/remove, which fits a read-heavy listener collection and aligns with the project's convention of using copy-on-write collections for concurrent listener access.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkstyle.org/opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/xml/tools/xml-extractor.jar --fileList=/tmp/codeql-scratch-8a343ad76595886d/dbs/java/working/files-to-index11279688604168215133.list --sourceArchiveDir=/tmp/codeql-scratch-8a343ad76595886d/dbs/java/src --outputDir=/tmp/codeql-scratch-8a343ad76595886d/dbs/java/trap/java(dns block)www.eclipse.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -classpath /home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/boot/plexus-classworlds-2.8.0.jar -Dclassworlds.conf=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/bin/m2.conf -Dmaven.home=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 -Dlibrary.jansi.path=/home/REDACTED/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/copilot-for-eclipse/copilot-for-eclipse org.codehaus.plexus.classworlds.launcher.Launcher -pl com.microsoft.copilot.eclipse.core -am compile -q(dns block)If you need me to access, download, or install something from one of these locations, you can either:
fixes microsoft/copilot-eclipse-feedback#181