Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
5758820679
Commit
def07fe50c
@ -34,7 +34,6 @@ import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -62,13 +61,10 @@ public class LinkageUtils {
|
||||
}
|
||||
|
||||
private void internalLinkOrUnlink(boolean unlink, Class<?> toLink) {
|
||||
AtomicLong totalTime = new AtomicLong();
|
||||
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(BauSystem.class.getResourceAsStream("/de.steamwar.bausystem/" + toLink.getTypeName().replace("$", "."))))) {
|
||||
bufferedReader.lines().forEach(s -> {
|
||||
try {
|
||||
long time = System.currentTimeMillis();
|
||||
linkOrUnlink(Class.forName(s), unlink);
|
||||
totalTime.addAndGet(System.currentTimeMillis() - time);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// ignored
|
||||
} catch (Exception e) {
|
||||
@ -80,7 +76,6 @@ public class LinkageUtils {
|
||||
} catch (NullPointerException e) {
|
||||
// Ignored
|
||||
}
|
||||
BauSystem.getInstance().getLogger().info("Linkage took " + totalTime + "ms");
|
||||
}
|
||||
|
||||
private void internalLinkFields() {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren