ConcurrentModificationError in GlamerSpinnersEffect
GameImpl.playPriority java.util.ConcurrentModificationException at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:911) at java.util.ArrayList$Itr.next(ArrayList.java:861) at mage.cards.g.GlamerSpinnersEffect.apply(GlamerSpinners.java:115) at mage.abilities.AbilityImpl.resolveMode(AbilityImpl.java:229) at mage.abilities.AbilityImpl.resolve(AbilityImpl.java:213) at mage.abilities.TriggeredAbilityImpl.resolve(TriggeredAbilityImpl.java:273) at mage.game.stack.StackAbility.resolve(StackAbility.java:85) at mage.game.GameImpl.resolve(GameImpl.java:1845) at mage.game.GameImpl.playPriority(GameImpl.java:1766) at mage.game.turn.Step.priority(Step.java:73) at mage.game.turn.Phase.playStep(Phase.java:205) at mage.game.turn.Phase.play(Phase.java:91) at mage.game.turn.Turn.play(Turn.java:132) at mage.game.GameImpl.playTurn(GameImpl.java:1183) at mage.game.GameImpl.play(GameImpl.java:1090) at mage.game.GameImpl.start(GameImpl.java:1066) at mage.server.game.GameWorker.call(GameWorker.java:35) at mage.server.game.GameWorker.call(GameWorker.java:16) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)
ETB effect of [[Glamer Spinners]] targeted Puresight Merrow which was enchanted with a Shield of the Oversoul. Only one legal target to attach, an Apothecary Initiate, but error completely broke the game when asking for choice. Rollback didn't even restore the state correctly. Neither player was able to regain priority afterwards.
Following repeated error: java.lang.IllegalStateException: Error in unit tests =>[GAME edf33d43-3d39-4cb5-b3da-012553318b89] GameWorker.call java.lang.IllegalStateException: Error in unit tests at mage.game.GameImpl.playPriority(GameImpl.java:1831) at mage.game.turn.Step.priority(Step.java:73) at mage.game.turn.Phase.playStep(Phase.java:205) at mage.game.turn.Phase.play(Phase.java:91) at mage.game.turn.Turn.play(Turn.java:132) at mage.game.GameImpl.playTurn(GameImpl.java:1183) at mage.game.GameImpl.play(GameImpl.java:1090) at mage.game.GameImpl.start(GameImpl.java:1066) at mage.server.game.GameWorker.call(GameWorker.java:35) at mage.server.game.GameWorker.call(GameWorker.java:16) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)
Glamer Spinners - (Gatherer) (Scryfall) (EDHREC)
{4}{W/U} Creature — Faerie Wizard 2/4 Flash Flying When this creature enters, attach all Auras enchanting target permanent to another permanent with the same controller.
Looks like a regression from a02313a0 - @theelk801 please be more careful
Looks like it tries to attach to itself, so ConcurrentModificationException raise:
Possible fix: modify addAttachment code somewhere and ignore on itself (“useless reattach”).
Or maybe not. Its already has “another” filter, so concurrent error is more deeper (maybe choose/selection code ignore that predicate after targeting refactor?).
I could catch the error in a simple test, and iterating over a copy of the list fixed it. That's what the old code used before careless refactor.
Feel free to investigate if there's something deeper.