From 7db9c4b8301a75c25e41b0b1b038bc57e3a3d1d6 Mon Sep 17 00:00:00 2001 From: theZorro266 Date: Wed, 5 May 2021 01:04:43 +0200 Subject: [PATCH] Move debug gui package Accept network.rs485.debug.gui --- .../commands/debug/DebugGuiController.java | 8 ++++---- .../network/rs485/debug/api/IDebugGuiEntry.java | 15 ++++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/common/logisticspipes/commands/commands/debug/DebugGuiController.java b/common/logisticspipes/commands/commands/debug/DebugGuiController.java index ee122265c2..a571b31275 100644 --- a/common/logisticspipes/commands/commands/debug/DebugGuiController.java +++ b/common/logisticspipes/commands/commands/debug/DebugGuiController.java @@ -30,6 +30,7 @@ public class DebugGuiController { static { Launch.classLoader.addTransformerExclusion("com.trolltech.qt."); Launch.classLoader.addTransformerExclusion("network.rs485.debuggui."); + Launch.classLoader.addTransformerExclusion("network.rs485.debug."); } transient private static DebugGuiController instance; @@ -53,11 +54,11 @@ public void execServer() { serverDebugger.values().forEach(IDebugGuiEntry::exec); } - private HashMap serverDebugger = new HashMap<>(); - private List serverList = new LinkedList<>(); + private final HashMap serverDebugger = new HashMap<>(); + private final List serverList = new LinkedList<>(); private IDebugGuiEntry clientController = null; - private List> clientList = new LinkedList<>(); + private final List> clientList = new LinkedList<>(); public void startWatchingOf(Object object, EntityPlayer player) { if (object == null) { @@ -70,7 +71,6 @@ public void startWatchingOf(Object object, EntityPlayer player) { serverDebugger.put(player, entry); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { e.printStackTrace(); - return; } } if (entry == null) { diff --git a/src/api/java/network/rs485/debug/api/IDebugGuiEntry.java b/src/api/java/network/rs485/debug/api/IDebugGuiEntry.java index b42d2518ba..e81005d1ca 100644 --- a/src/api/java/network/rs485/debug/api/IDebugGuiEntry.java +++ b/src/api/java/network/rs485/debug/api/IDebugGuiEntry.java @@ -41,14 +41,19 @@ public abstract class IDebugGuiEntry { - public abstract IDataConnection startServerDebugging(Object object, IDataConnection outgoingData, IObjectIdentification objectIdent); + public static IDebugGuiEntry create() + throws ClassNotFoundException, IllegalAccessException, InstantiationException { + try { + return (IDebugGuiEntry) Class.forName("network.rs485.debug.gui.DebugGuiEntry").newInstance(); + } catch (ReflectiveOperationException ignored) {} + return (IDebugGuiEntry) Class.forName("network.rs485.debuggui.DebugGuiEntry").newInstance(); + } + + public abstract IDataConnection startServerDebugging(Object object, IDataConnection outgoingData, + IObjectIdentification objectIdent); public abstract Future startClientDebugging(String name, IDataConnection outgoingData); public abstract void exec(); - public static IDebugGuiEntry create() throws ClassNotFoundException, IllegalAccessException, InstantiationException { - return (IDebugGuiEntry) Class.forName("network.rs485.debuggui.DebugGuiEntry").newInstance(); - } - }