Questions tagged [concurrentmodificationexception]
29 questions
0
votes
1 answer
How to recreate Iterator within ListIterator? ConcurrentModificationException
I have ListIterator and within it there is list2.iterator() which throws ConcurrentModificationException when 2nd iteration goes through ListIterator
ExecutorService executorService = new ThreadPoolExecutor(
1, // Initial pool…

janusz j
- 321
- 3
- 17
0
votes
0 answers
Swing's StyleGroupSet ConcurrentModificationException
I'm using Swing gui with my project with GraphStream's graph in it (not sure if it is relevant), and I keep getting ConcurrentModificationException exception from Swing's StyleGroupSet class.
How can I avoid it?
this is the exception's…

Kfir Ettinger
- 584
- 4
- 13
0
votes
1 answer
rocketMQTemplate.asyncSend throws ConcurrentModificationException at MessageDecoder.messageProperties2String
I am using rocketmq-spring to send message which version is 2.1.0, sometimes i got ConcurrentModificationException at org.apache.rocketmq.common.message.MessageDecoder.messageProperties2String(MessageDecoder.java:414),the following is a detailed…

dujingsong
- 1
- 2
0
votes
2 answers
Junit Testing issue with for loop and return statement
I'm kind of confused with a for-loop & return statements. I hope someone could explain me what's going on.
private Map list;
public RessourceBasedAccessControl32603() {
super();
list = new HashMap<>();
}
I have to…

Elli98
- 5
- 2
0
votes
1 answer
ConcurrentModificationException thrown by crop(x) and a.setFrom()
I am current lost in that problem. I have read a lot here about other problems with ConcurrentModificationException, but can't resolve my problem. Maybe i don't see the wood for the trees. I hope you can help me. The method is
public void…

Nareya
- 1
- 1
0
votes
0 answers
IntelliJ IDEA didn't report ConcurrentModificationException while it occurred
I met with a problem that, when I use for-iterator, I changed the list(ArrayList) to which the iterator belongs:
for (Term term : terms) {
for (int j = 0; j < expr2.getTerms().size(); j++) {
…

NormalLLer
- 183
- 2
- 11
0
votes
2 answers
Iterate through list and add to list without incurring ConcurrentModificationException - Java
Apologies, this has been done to death but I am really struggling to implement a solution to this problem and I am quite new to Java.
I need to be able to call a method which basically allows a Person object to be added to a list.
The main problem I…

Karl F
- 13
- 3
0
votes
0 answers
Stardog raises ConcurrentModificationException upon reasoned query on graph with SWRL Rules
When trying to execute a query with reasoning in a model, I get this error: 000012: com.complexible.stardog.plan.eval.operator.OperatorException: Uncaught error during query evaluation: ConcurrentModificationException
Ontology model has 2 SWRL rules…

lore-f
- 21
- 6
0
votes
2 answers
Avoid ConcurrentModificationException on java stream using cache
I'm getting occasionally ConcurrentModificationException with the following code:
public Set getTypes(Set names) {
Set myObjects = new HashSet<>();
myObjects =…

Ori Marko
- 56,308
- 23
- 131
- 233
0
votes
2 answers
ConcurrentModificationException while making .removeAll() method
I have code looks like this
public class ListAnalyzer {
public static List base;
public static void addOfflineToBase(String offline) {
base.add(offline);
}
public static List prepareArrayList() throws IOException {
base =…

k0dama1337
- 3
- 3
-1
votes
1 answer
How would this cause a concurrentModificationError?
I understand that when using foreach loops or iterators, and removing elements from a list while iterating through it, it can cause the error by confusing the iterator. however I don't seem to be able to visualize how it can confuse it. And thus Im…

Nadeem Hussain
- 3
- 1
-1
votes
1 answer
How to avoid "ConcurrentModificationException" while add ArrayList elements?
I'm trying to add an item to the ArrayList in a certain order
Iterator it = arr.iterator();
while(it.hasNext()){
Rating o = it.next();
int index = arr.indexOf(o);
if(o.getRating() < this.getRating()) {
arr.add(index,…

Стас Нікулиця
- 31
- 4
-1
votes
1 answer
Error when editing an excel file with Java (ConcurrentModificationException)
I'm trying to modify the last cell of the rows in an excel workbook that in any cell match another value.
In the first iteration it works fine, but in the second loop I get this java.util.ConcurrentModificationException error in the for (Cell cell…

Raúl Casado
- 293
- 1
- 2
- 13
-1
votes
1 answer
ConcurrentModificationException when removing item from a list
I have an application with custom list class. When trying to do a foreach function with customer argument following happens:
Important! I cannot modify code in main
Main:
XList lmod = XList.of(1,2,8, 10, 11, 30, 3,…

mattonaly
- 3
- 2