fix: 修复开发版本无法自动更新的问题 添加单元测试

Signed-off-by: 502647092 <admin@yumc.pw>
merge/6/HEAD
502647092 2017-08-22 19:24:32 +08:00
parent e578f33608
commit d767dba2e6
8 changed files with 189 additions and 160 deletions

15
pom.xml
View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId>
<artifactId>YumCore</artifactId>
<version>1.8.3</version>
<version>1.8.5</version>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
@ -66,7 +66,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.11.2-R0.1-SNAPSHOT</version>
<version>[1.12.1-R0.1-SNAPSHOT,)</version>
<exclusions>
<exclusion>
<artifactId>gson</artifactId>
@ -81,7 +81,7 @@
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.11-SNAPSHOT</version>
<version>[1.12-SNAPSHOT,)</version>
<exclusions>
<exclusion>
<artifactId>snakeyaml</artifactId>
@ -92,7 +92,7 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.5.1</version>
<version>[2.5.1,)</version>
<exclusions>
<exclusion>
<artifactId>spigot-api</artifactId>
@ -108,7 +108,7 @@
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.5.6</version>
<version>[1.5.6,)</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
@ -130,6 +130,11 @@
<artifactId>worldedit-bukkit</artifactId>
<version>6.1.5</version>
</dependency>
<dependency>
<groupId>io.puharesource.mc</groupId>
<artifactId>TitleManager</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>

View File

@ -2,7 +2,7 @@ package pw.yumc.YumCore.bukkit;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -27,6 +27,7 @@ public class Log {
private static Logger logger;
private static CommandSender console;
private static String prefix;
static {
try {
debug = globalDebug || P.getDescription().getVersion().contains("DEV");
@ -36,7 +37,6 @@ public class Log {
} catch (Throwable ex) {
logger = Logger.getLogger("YumCore");
debug = true;
d(ex);
}
}
@ -51,10 +51,10 @@ public class Log {
* that essentially act as default handlers for all loggers.
*
* @param handler
* a logging Handler
* a logging Handler
* @throws SecurityException
* if a security manager exists and if
* the caller does not have LoggingPermission("control").
* if a security manager exists and if
* the caller does not have LoggingPermission("control").
*/
public static void addHandler(Handler handler) throws SecurityException {
logger.addHandler(handler);
@ -64,7 +64,7 @@ public class Log {
* Sends console a message
*
* @param message
* Message to be displayed
* Message to be displayed
*/
public static void console(String message) {
console.sendMessage(prefix + message);
@ -74,9 +74,9 @@ public class Log {
* Sends console a message
*
* @param message
*
*
* @param object
*
*
*/
public static void console(String message, Object... object) {
console.sendMessage(prefix + String.format(message, object));
@ -86,7 +86,7 @@ public class Log {
* Sends console a message
*
* @param msg
* Message to be displayed
* Message to be displayed
*/
public static void console(String[] msg) {
for (String str : msg) {
@ -98,7 +98,7 @@ public class Log {
*
*
* @param msg
*
*
*/
public static void d(String msg) {
if (debug) {
@ -110,9 +110,9 @@ public class Log {
*
*
* @param msg
*
*
* @param object
*
*
*/
public static void d(String msg, Object... object) {
if (debug) {
@ -124,7 +124,7 @@ public class Log {
*
*
* @param e
*
*
*/
public static void d(Throwable e) {
if (debug) {
@ -136,9 +136,9 @@ public class Log {
*
*
* @param msg
*
*
* @param e
*
*
*/
public static void d(String msg, Throwable e) {
if (debug) {
@ -151,7 +151,7 @@ public class Log {
*
*
* @param msg
*
*
*/
public static void fd(String msg) {
if (fullDebug) {
@ -163,9 +163,9 @@ public class Log {
*
*
* @param msg
*
*
* @param object
*
*
*/
public static void fd(String msg, Object... object) {
if (fullDebug) {
@ -177,7 +177,7 @@ public class Log {
*
*
* @param e
*
*
*/
public static void fd(Throwable e) {
if (fullDebug) {
@ -189,9 +189,9 @@ public class Log {
*
*
* @param msg
*
*
* @param e
*
*
*/
public static void fd(String msg, Throwable e) {
if (fullDebug) {
@ -224,9 +224,9 @@ public class Log {
* <p>
*
* @param level
* One of the message level identifiers, e.g., SEVERE
* One of the message level identifiers, e.g., SEVERE
* @param msg
* The string message (or a key in the message catalog)
* The string message (or a key in the message catalog)
*/
public static void log(Level level, String msg) {
logger.log(level, msg);
@ -241,11 +241,11 @@ public class Log {
* <p>
*
* @param level
* One of the message level identifiers, e.g., SEVERE
* One of the message level identifiers, e.g., SEVERE
* @param msg
* The string message (or a key in the message catalog)
* The string message (or a key in the message catalog)
* @param param1
* parameter to the message
* parameter to the message
*/
public static void log(Level level, String msg, Object param1) {
logger.log(level, msg, param1);
@ -260,11 +260,11 @@ public class Log {
* <p>
*
* @param level
* One of the message level identifiers, e.g., SEVERE
* One of the message level identifiers, e.g., SEVERE
* @param msg
* The string message (or a key in the message catalog)
* The string message (or a key in the message catalog)
* @param params
* array of parameters to the message
* array of parameters to the message
*/
public static void log(Level level, String msg, Object[] params) {
logger.log(level, msg, params);
@ -284,11 +284,11 @@ public class Log {
* <p>
*
* @param level
* One of the message level identifiers, e.g., SEVERE
* One of the message level identifiers, e.g., SEVERE
* @param msg
* The string message (or a key in the message catalog)
* The string message (or a key in the message catalog)
* @param thrown
* Throwable associated with log message.
* Throwable associated with log message.
*/
public static void log(Level level, String msg, Throwable thrown) {
logger.log(level, msg, thrown);
@ -296,7 +296,7 @@ public class Log {
/**
* @param prefix
*
*
*/
public static void setPrefix(String prefix) {
Log.prefix = ChatColor.translateAlternateColorCodes('&', prefix);
@ -309,7 +309,7 @@ public class Log {
* given message is forwarded to all the registered output Handler objects.
*
* @param msg
* The string message (or a key in the message catalog)
* The string message (or a key in the message catalog)
*/
public static void severe(String msg) {
logger.severe(msg);
@ -319,9 +319,9 @@ public class Log {
* Sends this sender a message
*
* @param sender
*
*
* @param msg
*
*
*/
public static void sender(CommandSender sender, String msg) {
sender.sendMessage(prefix + msg);
@ -331,11 +331,11 @@ public class Log {
* Sends this sender a message
*
* @param sender
*
*
* @param msg
*
*
* @param objs
*
*
*/
public static void sender(CommandSender sender, String msg, Object... objs) {
sender.sendMessage(prefix + String.format(msg, objs));
@ -345,9 +345,9 @@ public class Log {
* Sends this sender a message
*
* @param sender
*
*
* @param msg
*
*
*/
public static void sender(CommandSender sender, String[] msg) {
Arrays.stream(msg).forEach(str -> sender(sender, str));
@ -357,7 +357,7 @@ public class Log {
*
*
* @param string
*
*
*/
public static void w(String string) {
logger.warning(string);
@ -367,14 +367,21 @@ public class Log {
*
*
* @param string
*
*
* @param objects
*
*
*/
public static void w(String string, Object... objects) {
w(String.format(string, objects));
}
/**
* @return
*/
public static boolean isDebug() {
return debug;
}
/**
* @return
*/
@ -382,23 +389,20 @@ public class Log {
return globalDebug;
}
public static String osn(List<?> classes) {
/**
*
*
* @param objects
*
* @return
*/
public static String getSimpleNames(Object... objects) {
StringBuilder str = new StringBuilder("[");
classes.forEach(c -> str.append(c == null ? null : c.getClass().getSimpleName()).append(", "));
return classes.isEmpty() ? "[]" : str.substring(0, str.length() - 2) + "]";
}
public static String osn(Object... classes) {
return osn(Arrays.asList(classes));
}
public static String csn(List<Class> classes) {
StringBuilder str = new StringBuilder("[");
classes.forEach(c -> str.append(c == null ? null : c.getSimpleName()).append(", "));
return classes.isEmpty() ? "[]" : str.substring(0, str.length() - 2) + "]";
}
public static String csn(Class[] classes) {
return csn(Arrays.asList(classes));
Arrays.stream(objects)
.forEach(o -> str.append(Optional.ofNullable(o)
.map(obj -> obj instanceof Class ? (Class) obj : obj.getClass())
.map(Class::getSimpleName)
.orElse(null)).append(", "));
return objects.length == 0 ? "[]" : str.substring(0, str.length() - 2) + "]";
}
}

View File

@ -7,18 +7,21 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.jar.JarFile;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
/**
* Instance
*
* @since 2016723 9:09:57
* @author
* @since 2016723 9:09:57
*/
public class P {
/**
@ -48,8 +51,7 @@ public class P {
/**
* @param name
*
*
*
* @return
*/
public static PluginCommand getCommand(String name) {
@ -58,7 +60,7 @@ public class P {
/**
* @param <FC>
*
*
* @return
*/
public static <FC> FC getConfig() {
@ -67,7 +69,7 @@ public class P {
/**
* @param <FC>
*
*
* @return
*/
public static <FC> FC getInjectConfig() {
@ -108,7 +110,7 @@ public class P {
/**
* @param <PI>
*
*
* @return
*/
public static <PI> PI getPlugin() {
@ -122,11 +124,21 @@ public class P {
return instance.isEnabled();
}
/**
*
*
* @param listeners
*
*/
public static void registerEvents(Listener... listeners) {
Arrays.stream(listeners).forEach(listener -> Bukkit.getPluginManager().registerEvents(listener, instance));
}
/**
*
*
* @param dirs
*
*
*/
public static void saveFile(final String... dirs) {
saveFile(false, dirs);
@ -134,11 +146,11 @@ public class P {
/**
*
*
*
* @param replace
*
*
* @param dirs
*
*
*/
public static void saveFile(boolean replace, final String... dirs) {
URL url = instance.getClass().getClassLoader().getResource("plugin.yml");

View File

@ -21,7 +21,7 @@ import pw.yumc.YumCore.commands.interfaces.HelpGenerator;
/**
*
*
*
* @author
* @since 2016/11/18 0018
*/
@ -46,9 +46,9 @@ public class CommandMain implements CommandExecutor {
/**
*
*
*
* @param clazzs
*
*
*/
public CommandMain(Executor... clazzs) {
register(clazzs);
@ -56,12 +56,12 @@ public class CommandMain implements CommandExecutor {
/**
*
*
*
* @param clazzs
*
*
* @return {@link CommandMain}
*/
public CommandMain register(Executor... clazzs) {
public void register(Executor... clazzs) {
for (Executor clazz : clazzs) {
Method[] methods = clazz.getClass().getDeclaredMethods();
for (Method method : methods) {
@ -70,30 +70,29 @@ public class CommandMain implements CommandExecutor {
}
help = new CommandHelp(cmds);
help.setHelpGenerator(helpGenerator);
return this;
}
private boolean registerCommand(Method method, Executor clazz) {
private void registerCommand(Method method, Executor clazz) {
CommandInfo ci = CommandInfo.parse(method, clazz);
if (ci != null) {
injectPluginCommand(ci);
Class[] params = method.getParameterTypes();
Log.d("注册主命令 %s 参数类型: %s", ci.getName(), Log.csn(params));
Log.d("注册主命令 %s 参数类型: %s", ci.getName(), Log.getSimpleNames((Object[]) params));
try {
Class<? extends CommandSender> sender = params[0];
cmds.add(ci);
return true;
} catch (ArrayIndexOutOfBoundsException | ClassCastException ignored) {
Log.w(argumentTypeError, method.getName(), clazz.getClass().getName());
}
Log.w(argumentTypeError, method.getName(), clazz.getClass().getName());
}
return false;
}
private void injectPluginCommand(CommandInfo ci) {
PluginCommand cmd = P.getCommand(ci.getName());
if (cmd == null) {
if ((cmd = CommandKit.create(ci.getName(), ci.getAliases().toArray(new String[] {}))) == null) { throw new IllegalStateException("未找到命令 必须在plugin.yml先注册 " + ci.getName() + " 命令!"); }
if ((cmd = CommandKit.create(ci.getName(), ci.getAliases().toArray(new String[]{}))) == null) {
throw new IllegalStateException("未找到命令 必须在plugin.yml先注册 " + ci.getName() + " 命令!");
}
}
cmd.setExecutor(this);
}
@ -102,7 +101,7 @@ public class CommandMain implements CommandExecutor {
*
*
* @param cmd
*
*
* @return
*/
private CommandInfo getByCache(String cmd) {

View File

@ -29,6 +29,7 @@ public class CommandParse {
private static Map<String, Class> primitiveMap = new HashMap<>();
private boolean isMain;
private List<Parse> parses = new LinkedList<>();
static {
register(File.class, FileParse.class);
register(Player.class, PlayerParse.class);
@ -68,7 +69,7 @@ public class CommandParse {
if (parse == null) { throw new ParseException(String.format("存在无法解析的参数类型 %s", clazz.getName())); }
this.parses.add(parse.parseAnnotation(annotations).handleAttrs());
}
Log.d("命令解析器 %s", Log.osn(parses));
Log.d("命令解析器 %s", Log.getSimpleNames(parses));
}
public static CommandParse get(Method method) {
@ -79,9 +80,9 @@ public class CommandParse {
*
*
* @param arr
*
*
* @param split
*
*
* @return
*/
public static String join(Object[] arr, String split) {
@ -114,7 +115,7 @@ public class CommandParse {
throw new ParseException(String.format("第 %s 个参数 %s", isMain ? 1 : 2 + i, e.getMessage()));
}
}
Log.d("解析参数: %s => %s", Arrays.toString(args), Log.osn(pobjs));
Log.d("解析参数: %s => %s", Arrays.toString(args), Log.getSimpleNames(pobjs));
return pobjs.toArray();
}

View File

@ -74,7 +74,7 @@ public class CommandSub implements TabExecutor {
*
*
* @param name
*
*
*/
public CommandSub(String name) {
cmd = plugin.getCommand(name);
@ -90,9 +90,9 @@ public class CommandSub implements TabExecutor {
*
*
* @param name
*
*
* @param executor
*
*
*/
public CommandSub(String name, Executor... executor) {
this(name);
@ -115,7 +115,7 @@ public class CommandSub implements TabExecutor {
*
*
* @param subcmd
*
*
* @return
*/
private CommandInfo getByCache(String subcmd) {
@ -137,21 +137,25 @@ public class CommandSub implements TabExecutor {
*
*
* @param sender
*
*
* @param command
*
*
* @param alias
*
*
* @param args
*
*
* @return 线
*/
private List<String> getPlayerTabComplete(CommandSender sender, Command command, String alias, String[] args) {
String lastWord = args[args.length - 1];
Player senderPlayer = sender instanceof Player ? (Player) sender : null;
List<String> matchedPlayers = new ArrayList<>();
C.Player.getOnlinePlayers().stream().filter(player -> (senderPlayer == null || senderPlayer.canSee(player)) && StringUtil.startsWithIgnoreCase(player.getName(), lastWord)).forEach(
player -> matchedPlayers.add(player.getName()));
C.Player.getOnlinePlayers()
.stream()
.filter(player -> (senderPlayer == null || senderPlayer.canSee(player)) && StringUtil.startsWithIgnoreCase(player.getName(),
lastWord))
.forEach(
player -> matchedPlayers.add(player.getName()));
return matchedPlayers;
}
@ -159,7 +163,7 @@ public class CommandSub implements TabExecutor {
*
*
* @param args
*
*
* @return
*/
private String[] moveStrings(String[] args) {
@ -203,10 +207,10 @@ public class CommandSub implements TabExecutor {
*
*
* @param clazzs
*
*
* @return {@link CommandSub}
*/
public CommandSub register(Executor... clazzs) {
public void register(Executor... clazzs) {
for (Executor clazz : clazzs) {
Log.d("解析执行类: %s", clazz.getClass().getName());
Method[] methods = clazz.getClass().getDeclaredMethods();
@ -219,23 +223,22 @@ public class CommandSub implements TabExecutor {
}
help = new CommandHelp(defCmd, cmds);
buildCmdNameCache();
return this;
}
/**
*
*
* @param method
*
*
* @param clazz
*
*
* @return
*/
private boolean registerCommand(Method method, Executor clazz) {
CommandInfo ci = CommandInfo.parse(method, clazz);
if (ci != null) {
Class[] params = method.getParameterTypes();
Log.d("注册子命令: %s 参数类型: %s", ci.getName(), Log.csn(params));
Log.d("注册子命令: %s 参数类型: %s", ci.getName(), Log.getSimpleNames((Object[]) params));
try {
Class<? extends CommandSender> sender = params[0];
// 用于消除unuse警告
@ -257,29 +260,28 @@ public class CommandSub implements TabExecutor {
* Tab
*
* @param method
*
*
* @param clazz
*
*
* @return
*/
private boolean registerTab(Method method, Executor clazz) {
private void registerTab(Method method, Executor clazz) {
CommandTabInfo ti = CommandTabInfo.parse(method, clazz);
if (ti != null) {
if (method.getReturnType().equals(List.class)) {
Log.d("注册子命令补全: %s ", method.getName());
tabs.add(ti);
return true;
} else {
Log.w(returnTypeError, method.getName(), clazz.getClass().getName());
}
Log.w(returnTypeError, method.getName(), clazz.getClass().getName());
}
return false;
}
/**
*
*
*
* @param commandErrorHanlder
*
*
* @return {@link CommandSub}
*/
public CommandSub setCommandErrorHanlder(ErrorHanlder commandErrorHanlder) {
@ -291,7 +293,7 @@ public class CommandSub implements TabExecutor {
*
*
* @param helpGenerator
*
*
* @return {@link CommandSub}
*/
public CommandSub setHelpGenerator(HelpGenerator helpGenerator) {
@ -303,7 +305,7 @@ public class CommandSub implements TabExecutor {
*
*
* @param helpParse
*
*
* @return {@link CommandSub}
*/
public CommandSub setHelpParse(HelpParse helpParse) {

View File

@ -3,7 +3,6 @@ package pw.yumc.YumCore.update;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLClassLoader;
@ -30,31 +29,21 @@ import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import pw.yumc.YumCore.bukkit.Log;
import pw.yumc.YumCore.bukkit.P;
import pw.yumc.YumCore.tellraw.Tellraw;
import pw.yumc.YumCore.text.Encrypt;
/**
*
*
* @since 201683 11:20:21
* @author
* @since 201683 11:20:21
*/
public class SubscribeTask implements Runnable, Listener {
/**
*
*/
private static JavaPlugin instance;
static {
try {
Object pluginClassLoader = SubscribeTask.class.getClassLoader();
Field field = pluginClassLoader.getClass().getDeclaredField("plugin");
field.setAccessible(true);
instance = (JavaPlugin) field.get(pluginClassLoader);
} catch (Exception e) {
Log.d(e);
}
}
private static JavaPlugin instance = P.instance;
/**
*
@ -82,7 +71,7 @@ public class SubscribeTask implements Runnable, Listener {
*
*
* @param type
* Maven
* Maven
*/
public SubscribeTask(UpdateType type) {
this(false, type);
@ -92,9 +81,9 @@ public class SubscribeTask implements Runnable, Listener {
*
*
* @param isSecret
*
*
* @param type
*
*
*/
public SubscribeTask(boolean isSecret, UpdateType type) {
this("master", isSecret, type);
@ -104,13 +93,14 @@ public class SubscribeTask implements Runnable, Listener {
*
*
* @param branch
*
*
* @param isSecret
*
*
* @param type
*
*
*/
public SubscribeTask(String branch, boolean isSecret, UpdateType type) {
Log.d("订阅更新 分支 %s 是否加密 %s 更新类型 %s", branch, isSecret, type.name());
updateFile = new UpdateFile(instance);
versionInfo = new VersionInfo(instance, branch, isSecret);
updateType = type;
@ -180,11 +170,11 @@ public class SubscribeTask implements Runnable, Listener {
public String getDownloadUrl(Plugin instance, String version) {
switch (this) {
case DIRECT:
case WS:
return String.format(url, instance.getName());
case MAVEN:
return String.format(url, instance.getClass().getPackage().getName().replaceAll("\\.", "/"), version, instance.getName());
case DIRECT:
case WS:
return String.format(url, instance.getName());
case MAVEN:
return String.format(url, instance.getClass().getPackage().getName().replaceAll("\\.", "/"), version, instance.getName());
}
throw new UnsupportedOperationException();
}
@ -216,7 +206,7 @@ public class SubscribeTask implements Runnable, Listener {
*
*
* @param plugin
* -
* -
* @return
*/
public File getPluginFile(Plugin plugin) {
@ -287,11 +277,11 @@ public class SubscribeTask implements Runnable, Listener {
/**
*
*
*
* @param tag
*
*
* @param def
*
*
* @return
*/
public String getPluginInfo(String tag, String def) {
@ -313,11 +303,11 @@ public class SubscribeTask implements Runnable, Listener {
*/
public String[] getUpdateChanges() {
final String des = getPluginInfo("update.changes", null);
if (des == null) { return new String[] {}; }
if (des == null) { return new String[]{}; }
String[] temp = ChatColor.translateAlternateColorCodes('&', des).replaceAll("\n", "").replaceAll("\u0009", "").split(";");
List<String> ltemp = new ArrayList<>();
Arrays.stream(temp).forEach(s -> ltemp.add(s.trim()));
return ltemp.toArray(new String[] {});
return ltemp.toArray(new String[]{});
}
/**
@ -341,9 +331,9 @@ public class SubscribeTask implements Runnable, Listener {
/**
*
*
*
* @param sender
*
*
*/
public void notify(CommandSender sender) {
Log.sender(sender, "§a插件更新: §b" + name + " §a已更新到最新版本 §bv" + getLastestVersion());
@ -367,9 +357,9 @@ public class SubscribeTask implements Runnable, Listener {
*
*
* @param v1
*
*
* @param v2
*
*
* @return
*/
public boolean needUpdate(String v1, String v2) {
@ -379,7 +369,7 @@ public class SubscribeTask implements Runnable, Listener {
int minLength = Math.min(va1.length, va2.length);// 取最小长度值
int diff = 0;
while (idx < minLength && (diff = va1[idx].length() - va2[idx].length()) == 0// 先比较长度
&& (diff = va1[idx].compareTo(va2[idx])) == 0) {// 再比较字符
&& (diff = va1[idx].compareTo(va2[idx])) == 0) {// 再比较字符
++idx;
}
// 如果已经分出大小 则直接返回 如果未分出大小 则再比较位数 有子版本的为大
@ -390,12 +380,11 @@ public class SubscribeTask implements Runnable, Listener {
public String getNewVersion() {
try {
String result = getLastestVersion();
if (version.contains("DEV") && !Log.isGlobalDebug()) {
if (Log.isDebug() && !Log.isGlobalDebug()) {
Log.console("§4注意: §c当前版本为开发版本 且未开启全局调试 已自动下载最新稳定版!");
return result;
}
String current = version.split("-")[0];
if (needUpdate(result, current)) { return result; }
if (needUpdate(result, version)) { return result; }
} catch (Exception e) {
Log.d(e);
}

View File

@ -0,0 +1,17 @@
package pw.yumc.YumCore.bukkit;
import org.junit.Assert;
import org.junit.Test;
/**
* Created with IntelliJ IDEA
*
* @author
* Created on 2017/8/22 15:16.
*/
public class LogTest {
@Test
public void testSimpleNames() {
Assert.assertTrue("[LogTest, LogTest, null]".equals(Log.getSimpleNames(this, this.getClass(), null)));
}
}