Undercover Operative copy applier class cast exception when copying a token
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 940
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 160
Description
Attempted to use Mirage Mockery to clone an Undercover Operative that had cloned a Talion, the Kindly Lord which was a token created by Irenicus's Vile Duplication and therefore not Legendary.
Client version: 1.4.57-V2 (build: 2025-04-19 14:23)
Java version: 1.8.0_201
Default charset: UTF-8
Game error occurred:
java.lang.ClassCastException: mage.game.permanent.token.EmptyToken cannot be cast to mage.game.permanent.Permanent
Server version: 1.4.57-V2 (build: 2025-04-19 14:23)
Stack trace:
mage.cards.u.UndercoverOperativeApplier.apply(UndercoverOperative.java:59)
mage.abilities.effects.common.CreateTokenCopyTargetEffect.apply(CreateTokenCopyTargetEffect.java:210)
mage.abilities.AbilityImpl.resolveMode(AbilityImpl.java:226)
mage.abilities.AbilityImpl.resolve(AbilityImpl.java:213)
mage.game.stack.Spell.resolve(Spell.java:312)
mage.game.GameImpl.resolve(GameImpl.java:1815)
mage.game.GameImpl.playPriority(GameImpl.java:1738)
mage.game.turn.Step.priority(Step.java:73)
mage.game.turn.Phase.playStep(Phase.java:205)
mage.game.turn.Phase.play(Phase.java:91)
mage.game.turn.Turn.play(Turn.java:129)
mage.game.GameImpl.playTurn(GameImpl.java:1157)
mage.game.GameImpl.play(GameImpl.java:1064)
mage.game.GameImpl.start(GameImpl.java:1040)
mage.server.game.GameWorker.call(GameWorker.java:35)
mage.server.game.GameWorker.call(GameWorker.java:16)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at mage/cards/u/UndercoverOperativeApplier.java:59, then trace the copy flow through mage/abilities/effects/common/CreateTokenCopyTargetEffect.java:210. Reproduce the Undercover Operative scenario involving a token created by Irenicus's Vile Duplication and verify that copying it no longer produces the reported ClassCastException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100