Bugfixes with != instead of equals and default toString calls

This commit is contained in:
vraskulin 2017-02-15 19:52:20 +03:00
parent 752392fc46
commit a15220d51e
74 changed files with 187 additions and 147 deletions

View file

@ -28,6 +28,7 @@ import org.mage.test.player.TestPlayer;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -135,7 +136,7 @@ public abstract class MageTestBase {
try {
classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL());
logger.info("Loading game type: " + plugin.getClassName());
return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance();
return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
} catch (ClassNotFoundException ex) {
logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder");
} catch (Exception ex) {
@ -148,7 +149,7 @@ public abstract class MageTestBase {
try {
classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL());
logger.info("Loading tournament type: " + plugin.getClassName());
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance();
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
} catch (ClassNotFoundException ex) {
logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder");
} catch (Exception ex) {

View file

@ -26,6 +26,7 @@ import org.mage.test.player.TestPlayer;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -121,7 +122,7 @@ public abstract class MageTestPlayerBase {
try {
classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL());
logger.info("Loading game type: " + plugin.getClassName());
return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance();
return (MatchType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
} catch (ClassNotFoundException ex) {
logger.warn("Game type not found:" + plugin.getJar() + " - check plugin folder");
} catch (Exception ex) {
@ -134,7 +135,7 @@ public abstract class MageTestPlayerBase {
try {
classLoader.addURL(new File(pluginFolder + '/' + plugin.getJar()).toURI().toURL());
logger.info("Loading tournament type: " + plugin.getClassName());
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).newInstance();
return (TournamentType) Class.forName(plugin.getTypeName(), true, classLoader).getConstructor().newInstance();
} catch (ClassNotFoundException ex) {
logger.warn("Tournament type not found:" + plugin.getJar() + " - check plugin folder");
} catch (Exception ex) {