Tests: added test to check copy() methods removes;

This commit is contained in:
Oleg Agafonov 2019-03-30 20:26:35 +04:00
parent 1c2f5d7940
commit b8782d572d
2 changed files with 34 additions and 1 deletions

View file

@ -8,6 +8,7 @@ import java.util.UUID;
import mage.constants.WatcherScope;
import mage.game.Game;
import mage.game.events.GameEvent;
import org.apache.log4j.Logger;
/**
*
@ -17,6 +18,8 @@ import mage.game.events.GameEvent;
*/
public abstract class Watcher implements Serializable {
private static final Logger logger = Logger.getLogger(Watcher.class);
protected UUID controllerId;
protected UUID sourceId;
protected boolean condition;
@ -84,7 +87,7 @@ public abstract class Watcher implements Serializable {
constructor.setAccessible(true);
return (T) constructor.newInstance(this);
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
e.printStackTrace();
logger.error("Can't copy watcher: " + e.getMessage(), e);
}
return null;
}