#java.util.ConcurrentModificationException

1 messages · Page 1 of 1 (latest)

cursive raftBOT
#

<@&987246399047479336> please have a look, thanks.

cursive raftBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

hoary pagoda
#

haven't seen the code, but that error usually means your trying the alter the code in a place where it cannot be alterd

olive onyx
#

this is code

hoary pagoda
#

key = nonterminals.remove(0)+"";

#

probably there

olive onyx
#

variableProduction.put(key,newProductionList );

#

when i comment this it works

#

how can i fix

woven crest
#

You can't modify a collection while iterating over it. I think the first put call is fine as the key already exists, but the second one breaks. What behavior are you expecting? Do you want the loop to go over the added entries?

hoary pagoda
#

or check if the key exists and update the contents

olive onyx
#

but it needs to be added there :((((

hoary pagoda
#

then u need to rework the algo so it adds after the collection is not in use

olive onyx
#

if i add another hash

#

or what can i use instead of iterator

static patio
#

why did you delete the code?

#

I was reading it