simplify version getting code (and fix IDEA warning)

This commit is contained in:
Anton Keks 2014-03-12 21:44:12 +02:00
parent 0dc99442d5
commit 4dd7bd45f9

View File

@ -58,7 +58,7 @@ public class Version {
}
private static void loadVersionFromJar() {
String path = Version.class.getClassLoader().getResource(Version.class.getName().replace('.', '/') + ".class").toString();
String path = Version.class.getProtectionDomain().getCodeSource().getLocation().toString();
if (path.startsWith("jar:file:")) {
path = path.substring(4, path.indexOf('!'));
try {