Program: 158802
Project: 158802
Buggy source:
@Override public boolean moveToZone(Zone toZone,UUID sourceId,Game game,boolean flag,ArrayList<UUID> appliedEffects){
  Zone fromZone=game.getState().getZone(objectId);
  ZoneChangeEvent event=new ZoneChangeEvent(this.objectId,sourceId,ownerId,fromZone,toZone,appliedEffects);
  if (!game.replaceEvent(event)) {
    if (event.getFromZone() != null) {
switch (event.getFromZone()) {
case GRAVEYARD:
        game.getPlayer(ownerId).removeFromGraveyard(this,game);
      break;
case HAND:
    game.getPlayer(ownerId).removeFromHand(this,game);
  break;
case LIBRARY:
game.getPlayer(ownerId).removeFromLibrary(this,game);
break;
case EXILED:
game.getExile().removeCard(this,game);
break;
case OUTSIDE:
game.getPlayer(ownerId).getSideboard().remove(this);
break;
case COMMAND:
game.getState().getCommand().remove((Commander)game.getObject(objectId));
break;
case STACK:
StackObject stackObject=game.getStack().getSpell(getSpellAbility().getId());
if (stackObject == null && (this instanceof SplitCard)) {
stackObject=game.getStack().getSpell(((SplitCard)this).getLeftHalfCard().getId());
if (stackObject == null) {
stackObject=game.getStack().getSpell(((SplitCard)this).getRightHalfCard().getId());
}
}
if (stackObject != null) {
game.getStack().remove(stackObject);
}
break;
case PICK:
case BATTLEFIELD:
break;
default :
Card sourceCard=game.getCard(sourceId);
logger.fatal(new StringBuilder("String_Node_Str").append(fromZone).append("String_Node_Str").append(this.getName()).append("String_Node_Str").append(toZone).append("String_Node_Str").append(sourceCard != null ? sourceCard.getName() : "String_Node_Str").append("String_Node_Str").toString());
break;
}
game.rememberLKI(objectId,event.getFromZone(),this);
}
setFaceDown(false,game);
updateZoneChangeCounter(game);
switch (event.getToZone()) {
case GRAVEYARD:
game.getPlayer(ownerId).putInGraveyard(this,game,!flag);
break;
case HAND:
game.getPlayer(ownerId).getHand().add(this);
break;
case STACK:
game.getStack().push(new Spell(this,this.getSpellAbility().copy(),ownerId,event.getFromZone()));
break;
case EXILED:
game.getExile().getPermanentExile().add(this);
break;
case COMMAND:
game.addCommander(new Commander(this));
break;
case LIBRARY:
if (flag) {
game.getPlayer(ownerId).getLibrary().putOnTop(this,game);
}
 else {
game.getPlayer(ownerId).getLibrary().putOnBottom(this,game);
}
break;
case BATTLEFIELD:
PermanentCard permanent=new PermanentCard(this,event.getPlayerId(),game);
game.addPermanent(permanent);
game.setZone(objectId,Zone.BATTLEFIELD);
game.setScopeRelevant(true);
game.applyEffects();
boolean entered=permanent.entersBattlefield(sourceId,game,event.getFromZone(),true);
game.setScopeRelevant(false);
game.applyEffects();
if (entered) {
if (flag) {
permanent.setTapped(true);
}
event.setTarget(permanent);
}
 else {
return false;
}
break;
default :
Card sourceCard=game.getCard(sourceId);
logger.fatal(new StringBuilder("String_Node_Str").append(toZone).append("String_Node_Str").append(this.getName()).append("String_Node_Str").append(toZone).append("String_Node_Str").append(sourceCard != null ? sourceCard.getName() : "String_Node_Str").append("String_Node_Str").toString());
return false;
}
game.setZone(objectId,event.getToZone());
game.addSimultaneousEvent(event);
return game.getState().getZone(objectId) == toZone;
}
return false;
}

Fixed version (ground truth):
@Override public boolean moveToZone(Zone toZone,UUID sourceId,Game game,boolean flag,ArrayList<UUID> appliedEffects){
  Zone fromZone=game.getState().getZone(objectId);
  ZoneChangeEvent event=new ZoneChangeEvent(this.objectId,sourceId,ownerId,fromZone,toZone,appliedEffects);
  if (!game.replaceEvent(event)) {
    if (event.getFromZone() != null) {
switch (event.getFromZone()) {
case GRAVEYARD:
        game.getPlayer(ownerId).removeFromGraveyard(this,game);
      break;
case HAND:
    game.getPlayer(ownerId).removeFromHand(this,game);
  break;
case LIBRARY:
game.getPlayer(ownerId).removeFromLibrary(this,game);
break;
case EXILED:
game.getExile().removeCard(this,game);
break;
case OUTSIDE:
game.getPlayer(ownerId).getSideboard().remove(this);
break;
case COMMAND:
game.getState().getCommand().remove((Commander)game.getObject(objectId));
break;
case STACK:
StackObject stackObject=game.getStack().getSpell(getSpellAbility().getId());
if (stackObject == null && (this instanceof SplitCard)) {
stackObject=game.getStack().getSpell(((SplitCard)this).getLeftHalfCard().getId());
if (stackObject == null) {
stackObject=game.getStack().getSpell(((SplitCard)this).getRightHalfCard().getId());
}
}
if (stackObject == null) {
stackObject=game.getStack().getSpell(getId());
}
if (stackObject != null) {
game.getStack().remove(stackObject);
}
break;
case PICK:
case BATTLEFIELD:
break;
default :
Card sourceCard=game.getCard(sourceId);
logger.fatal(new StringBuilder("String_Node_Str").append(fromZone).append("String_Node_Str").append(this.getName()).append("String_Node_Str").append(toZone).append("String_Node_Str").append(sourceCard != null ? sourceCard.getName() : "String_Node_Str").append("String_Node_Str").toString());
break;
}
game.rememberLKI(objectId,event.getFromZone(),this);
}
setFaceDown(false,game);
updateZoneChangeCounter(game);
switch (event.getToZone()) {
case GRAVEYARD:
game.getPlayer(ownerId).putInGraveyard(this,game,!flag);
break;
case HAND:
game.getPlayer(ownerId).getHand().add(this);
break;
case STACK:
game.getStack().push(new Spell(this,this.getSpellAbility().copy(),ownerId,event.getFromZone()));
break;
case EXILED:
game.getExile().getPermanentExile().add(this);
break;
case COMMAND:
game.addCommander(new Commander(this));
break;
case LIBRARY:
if (flag) {
game.getPlayer(ownerId).getLibrary().putOnTop(this,game);
}
 else {
game.getPlayer(ownerId).getLibrary().putOnBottom(this,game);
}
break;
case BATTLEFIELD:
PermanentCard permanent=new PermanentCard(this,event.getPlayerId(),game);
game.addPermanent(permanent);
game.setZone(objectId,Zone.BATTLEFIELD);
game.setScopeRelevant(true);
game.applyEffects();
boolean entered=permanent.entersBattlefield(sourceId,game,event.getFromZone(),true);
game.setScopeRelevant(false);
game.applyEffects();
if (entered) {
if (flag) {
permanent.setTapped(true);
}
event.setTarget(permanent);
}
 else {
return false;
}
break;
default :
Card sourceCard=game.getCard(sourceId);
logger.fatal(new StringBuilder("String_Node_Str").append(toZone).append("String_Node_Str").append(this.getName()).append("String_Node_Str").append(toZone).append("String_Node_Str").append(sourceCard != null ? sourceCard.getName() : "String_Node_Str").append("String_Node_Str").toString());
return false;
}
game.setZone(objectId,event.getToZone());
game.addSimultaneousEvent(event);
return game.getState().getZone(objectId) == toZone;
}
return false;
}