mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 02:20:44 +00:00
Fixed code style
This commit is contained in:
@@ -46,5 +46,5 @@ public class DebugAdapter implements DebugListener {
|
||||
public byte[] onRequestBytes(String clientId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -27,10 +27,10 @@ public interface DebugListener {
|
||||
public void onLoaderURL(String clientId, String url);
|
||||
|
||||
public void onLoaderBytes(String clientId, byte[] data);
|
||||
|
||||
|
||||
public void onDumpByteArray(String clientId, byte[] data);
|
||||
|
||||
public void onFinish(String clientId);
|
||||
|
||||
|
||||
public byte[] onRequestBytes(String clientId);
|
||||
}
|
||||
|
||||
@@ -46,22 +46,19 @@ public class Debugger {
|
||||
public static final int MSG_LOADER_BYTES = 2;
|
||||
|
||||
public static final int MSG_DUMP_BYTEARRAY = 3;
|
||||
|
||||
|
||||
public static final int MSG_REQUEST_BYTEARRAY = 4;
|
||||
|
||||
|
||||
|
||||
private static final Set<DebugListener> listeners = new HashSet<>();
|
||||
|
||||
private static Logger logger = Logger.getLogger(Debugger.class.getName());
|
||||
|
||||
|
||||
private static boolean active = false;
|
||||
|
||||
public static boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public synchronized void addMessageListener(DebugListener l) {
|
||||
listeners.add(l);
|
||||
}
|
||||
@@ -84,7 +81,6 @@ public class Debugger {
|
||||
|
||||
private final Map<String, String> parameters = new HashMap<>();
|
||||
|
||||
|
||||
public String getParameter(String name, String defValue) {
|
||||
if (parameters.containsKey(name)) {
|
||||
return parameters.get(name);
|
||||
@@ -133,7 +129,7 @@ public class Debugger {
|
||||
os.write(data.length & 0xff);
|
||||
os.write(data);
|
||||
}
|
||||
|
||||
|
||||
private byte[] readBytes(InputStream is) throws IOException {
|
||||
int len = is.read();
|
||||
if (len == -1) {
|
||||
@@ -187,8 +183,7 @@ public class Debugger {
|
||||
@Override
|
||||
public void run() {
|
||||
String clientName = Integer.toString(id);
|
||||
try (InputStream is = s.getInputStream();
|
||||
OutputStream os = s.getOutputStream()) {
|
||||
try (InputStream is = s.getInputStream(); OutputStream os = s.getOutputStream()) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
int c;
|
||||
@@ -227,25 +222,25 @@ public class Debugger {
|
||||
}
|
||||
while (true) {
|
||||
int type = 0;
|
||||
logger.finer("reading type...");
|
||||
logger.finer("reading type...");
|
||||
if (hasType) {
|
||||
type = readType(is);
|
||||
}
|
||||
logger.log(Level.FINE, "received type {0}", type);
|
||||
switch (type) {
|
||||
case MSG_STRING:
|
||||
logger.finer("reading string...");
|
||||
logger.finer("reading string...");
|
||||
ret = readString(is);
|
||||
logger.finer("informing listeners...");
|
||||
logger.finer("informing listeners...");
|
||||
for (DebugListener l : listeners) {
|
||||
l.onMessage(clientName, ret);
|
||||
}
|
||||
logger.finer("listeners informed");
|
||||
break;
|
||||
case MSG_LOADER_URL:
|
||||
logger.finer("reading string...");
|
||||
logger.finer("reading string...");
|
||||
ret = readString(is);
|
||||
logger.finer("informing listeners...");
|
||||
logger.finer("informing listeners...");
|
||||
for (DebugListener l : listeners) {
|
||||
l.onLoaderURL(clientName, ret);
|
||||
}
|
||||
@@ -254,7 +249,7 @@ public class Debugger {
|
||||
case MSG_LOADER_BYTES:
|
||||
logger.finer("reading bytes...");
|
||||
byte[] retB = readBytes(is);
|
||||
logger.finer("informing listeners...");
|
||||
logger.finer("informing listeners...");
|
||||
for (DebugListener l : listeners) {
|
||||
l.onLoaderBytes(clientName, retB);
|
||||
}
|
||||
@@ -263,14 +258,14 @@ public class Debugger {
|
||||
case MSG_DUMP_BYTEARRAY:
|
||||
logger.finer("reading bytes...");
|
||||
byte[] retBa = readBytes(is);
|
||||
logger.finer("informing listeners...");
|
||||
logger.finer("informing listeners...");
|
||||
for (DebugListener l : listeners) {
|
||||
l.onDumpByteArray(clientName, retBa);
|
||||
}
|
||||
logger.finer("listeners informed");
|
||||
break;
|
||||
case MSG_REQUEST_BYTEARRAY:
|
||||
logger.finer("checking listeners for data...");
|
||||
logger.finer("checking listeners for data...");
|
||||
boolean dataFound = false;
|
||||
for (DebugListener l : listeners) {
|
||||
byte[] data = l.onRequestBytes(clientName);
|
||||
|
||||
@@ -46,8 +46,8 @@ public class DebuggerTools {
|
||||
|
||||
public static final String DEBUGGER_PACKAGE = "com.jpexs.decompiler.flash.debugger";
|
||||
|
||||
private static volatile Debugger debugger;
|
||||
|
||||
private static volatile Debugger debugger;
|
||||
|
||||
private static ScriptPack getDebuggerScriptPack(SWF swf) {
|
||||
List<ABC> allAbcList = new ArrayList<>();
|
||||
for (ABCContainerTag ac : swf.getAbcList()) {
|
||||
@@ -262,9 +262,7 @@ public class DebuggerTools {
|
||||
ft.useNetwork = true;
|
||||
ft.setModified(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Add call to DebugConnection.initClient("") to the document class
|
||||
/*String documentClass = swf.getDocumentClass();
|
||||
if (documentClass != null) {
|
||||
@@ -301,8 +299,7 @@ public class DebuggerTools {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
*/
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, "Error while attaching debugger", ex);
|
||||
//ignore
|
||||
|
||||
Reference in New Issue
Block a user