From e7ba043135c93c3fe3d325e1b05f40e48587ebb9 Mon Sep 17 00:00:00 2001 From: Honfika Date: Sat, 15 Mar 2014 07:43:16 +0100 Subject: [PATCH] timeout fixes --- trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java | 5 +++-- .../src/com/jpexs/decompiler/flash/abc/types/MethodBody.java | 2 +- trunk/src/com/jpexs/decompiler/flash/action/Action.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java index 8b88543bb..4ce47afa8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/ScriptPack.java @@ -150,6 +150,7 @@ public class ScriptPack implements TreeElementItem { public void toSource(GraphTextWriter writer, final List abcList, final Trait[] traits, final ScriptExportMode exportMode, final boolean parallel) throws InterruptedException { writer.suspendMeasure(); + int timeout = Configuration.decompilationTimeoutFile.get(); try { CancellableWorker.call(new Callable() { @Override @@ -157,11 +158,11 @@ public class ScriptPack implements TreeElementItem { convert(new NulWriter(), abcList, traits, exportMode, parallel); return null; } - }, Configuration.decompilationTimeoutFile.get(), TimeUnit.SECONDS); + }, timeout, TimeUnit.SECONDS); } catch (TimeoutException ex) { writer.continueMeasure(); Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", ex); - Helper.appendTimeoutComment(writer, Configuration.decompilationTimeoutFile.get()); + Helper.appendTimeoutComment(writer, timeout); return; } catch (ExecutionException ex) { writer.continueMeasure(); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java index e3dde0dc1..aef390fcc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/MethodBody.java @@ -178,7 +178,7 @@ public class MethodBody implements Cloneable, Serializable { writer.endMethod(); } else if (convertException instanceof TimeoutException) { Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", convertException); - Helper.appendTimeoutComment(writer, Configuration.decompilationTimeoutFile.get()); + Helper.appendTimeoutComment(writer, timeout); } else { Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", convertException); Helper.appendErrorComment(writer, convertException); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index 2e9d1b89d..2b4063f67 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -763,7 +763,7 @@ public class Action implements GraphSourceItem { Graph.graphToString(tree, writer, new LocalData()); } else if (convertException instanceof TimeoutException) { Logger.getLogger(Action.class.getName()).log(Level.SEVERE, "Decompilation error", convertException); - Helper.appendTimeoutComment(writer, Configuration.decompilationTimeoutFile.get()); + Helper.appendTimeoutComment(writer, timeout); } else { Logger.getLogger(Action.class.getName()).log(Level.SEVERE, "Decompilation error", convertException); Helper.appendErrorComment(writer, convertException);