mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 17:01:01 +00:00
small fixes, error handling
This commit is contained in:
@@ -58,6 +58,9 @@ public abstract class Trait implements Serializable {
|
||||
//if (abc.constants.constant_namespace[m.namespace_index].kind == Namespace.KIND_NAMESPACE) {
|
||||
{
|
||||
for (ABCContainerTag abcTag : abcTags) {
|
||||
if (m.namespace_index == -1) {
|
||||
break;
|
||||
}
|
||||
nsname = abcTag.getABC().nsValueToName(abc.constants.constant_namespace[m.namespace_index].getName(abc.constants));
|
||||
if (nsname.equals("-")) {
|
||||
break;
|
||||
|
||||
@@ -387,9 +387,9 @@ public class Configuration {
|
||||
|
||||
Object defaultValue = getDefaultValue(field);
|
||||
if (config.containsKey(name)) {
|
||||
field.set(null, new ConfigurationItem(field.getName(), defaultValue, config.get(name)));
|
||||
field.set(null, new ConfigurationItem(name, defaultValue, config.get(name)));
|
||||
} else {
|
||||
field.set(null, new ConfigurationItem(field.getName(), defaultValue));
|
||||
field.set(null, new ConfigurationItem(name, defaultValue));
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException ex) {
|
||||
|
||||
@@ -34,10 +34,12 @@ public class ConfigurationItem<T> {
|
||||
}
|
||||
|
||||
public ConfigurationItem(String name, T defaultValue) {
|
||||
this.name = name;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public ConfigurationItem(String name, T defaultValue, T value) {
|
||||
this.name = name;
|
||||
hasValue = true;
|
||||
this.defaultValue = defaultValue;
|
||||
this.value = value;
|
||||
|
||||
@@ -224,7 +224,7 @@ public class CommandLineArgumentParser {
|
||||
if (key.toLowerCase().equals(item.getName().toLowerCase())) {
|
||||
Boolean bValue = parseBooleanConfigValue(value);
|
||||
if (bValue != null) {
|
||||
System.out.println("Config " + item + " set to " + bValue);
|
||||
System.out.println("Config " + item.getName() + " set to " + bValue);
|
||||
item.set(bValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,6 +349,8 @@ public class Main {
|
||||
|
||||
public static boolean openFile(String swfFile) {
|
||||
try {
|
||||
File file = new File(swfFile);
|
||||
swfFile = file.getCanonicalPath();
|
||||
Configuration.addRecentFile(swfFile);
|
||||
boolean ok = openFile(swfFile, new FileInputStream(swfFile));
|
||||
if (ok) {
|
||||
|
||||
@@ -3067,8 +3067,11 @@ public final class MainFrame extends AppRibbonFrame implements ActionListener, T
|
||||
}, new Callback<AsyncResult<Void>>() {
|
||||
|
||||
@Override
|
||||
public void call(AsyncResult<Void> arg1) {
|
||||
public void call(AsyncResult<Void> result) {
|
||||
setSourceTask = null;
|
||||
if (result.error != null) {
|
||||
abcPanel.decompiledTextArea.setText("//Decompilation error: " + result.error);
|
||||
}
|
||||
Main.stopWork();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -392,8 +392,11 @@ public class ActionPanel extends JPanel implements ActionListener {
|
||||
}, new Callback<AsyncResult<Void>>() {
|
||||
|
||||
@Override
|
||||
public void call(AsyncResult<Void> arg1) {
|
||||
public void call(AsyncResult<Void> result) {
|
||||
setSourceTask = null;
|
||||
if (result.error != null) {
|
||||
decompiledEditor.setText("//Decompilation error: " + result.error);
|
||||
}
|
||||
Main.stopWork();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user