mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-16 19:44:07 +00:00
small fixes, cleanup
This commit is contained in:
@@ -24,7 +24,7 @@ import java.util.ResourceBundle;
|
||||
*/
|
||||
public class AppResources {
|
||||
|
||||
private static final ResourceBundle resourceBundle = ResourceBundle.getBundle("com.jpexs.decompiler.flash.gui.locales.AppResources");
|
||||
private static final ResourceBundle resourceBundle = ResourceBundle.getBundle("com.jpexs.decompiler.flash.locales.AppResources");
|
||||
|
||||
public static String translate(String key) {
|
||||
return resourceBundle.getString(key);
|
||||
|
||||
@@ -1185,6 +1185,31 @@ public final class SWF implements TreeItem, Timelined {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Map<String, ASMSource> getASMs() {
|
||||
List<TreeNode> list = createASTagList(tags, this);
|
||||
Map<String, ASMSource> asms = new HashMap<>();
|
||||
getASMs("", list, asms);
|
||||
return asms;
|
||||
}
|
||||
|
||||
private static void getASMs(String path, List<TreeNode> nodes, Map<String, ASMSource> result) {
|
||||
for (TreeNode n : nodes) {
|
||||
String subPath = path + "/" + n.toString();
|
||||
if (n.getItem() instanceof ASMSource) {
|
||||
//cacheScript((ASMSource) n.tag);
|
||||
String npath = subPath;
|
||||
int ppos = 1;
|
||||
while (result.containsKey(npath)) {
|
||||
ppos++;
|
||||
npath = subPath + "[" + ppos + "]";
|
||||
}
|
||||
result.put(npath, (ASMSource) n.getItem());
|
||||
}
|
||||
|
||||
getASMs(subPath, n.subNodes, result);
|
||||
}
|
||||
}
|
||||
|
||||
public static void getTagsFromTreeNodes(List<TreeNode> treeNodes, List<Tag> result) {
|
||||
for (TreeNode treeNode : treeNodes) {
|
||||
TreeItem treeItem = treeNode.getItem();
|
||||
|
||||
@@ -56,7 +56,7 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
public ABCException[] exceptions = new ABCException[0];
|
||||
public Traits traits = new Traits();
|
||||
public transient List<GraphTargetItem> convertedItems;
|
||||
public transient Exception convertException;
|
||||
public transient Throwable convertException;
|
||||
|
||||
public List<Integer> getExceptionEntries() {
|
||||
List<Integer> ret = new ArrayList<>();
|
||||
@@ -152,11 +152,12 @@ public class MethodBody implements Cloneable, Serializable {
|
||||
}
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (Exception ex) {
|
||||
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
|
||||
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", ex);
|
||||
convertException = ex;
|
||||
if (ex instanceof ExecutionException && ex.getCause() instanceof Exception) {
|
||||
convertException = (Exception) ex.getCause();
|
||||
Throwable cause = ex.getCause();
|
||||
if (ex instanceof ExecutionException && cause instanceof Exception) {
|
||||
convertException = (Exception) cause;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,11 +693,14 @@ public class Action implements GraphSourceItem {
|
||||
return tree;
|
||||
}
|
||||
}, timeout, TimeUnit.SECONDS);
|
||||
} catch (TimeoutException | ExecutionException | OutOfMemoryError | TranslateException | StackOverflowError ex) {
|
||||
} catch (InterruptedException ex) {
|
||||
throw ex;
|
||||
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
|
||||
Logger.getLogger(Action.class.getName()).log(Level.SEVERE, "Decompilation error in: " + path, ex);
|
||||
convertException = ex;
|
||||
if (ex instanceof ExecutionException && ex.getCause() instanceof Exception) {
|
||||
convertException = (Exception) ex.getCause();
|
||||
Throwable cause = ex.getCause();
|
||||
if (ex instanceof ExecutionException && cause instanceof Exception) {
|
||||
convertException = cause;
|
||||
}
|
||||
}
|
||||
writer.continueMeasure();
|
||||
|
||||
Reference in New Issue
Block a user