mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-13 05:58:33 +00:00
Test data fixed
Better exception handling in FFDec AS3 compiler
This commit is contained in:
@@ -15,6 +15,20 @@ public class As3ScriptReplaceException extends Exception {
|
||||
this.exceptionItems = exceptionItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (As3ScriptReplaceExceptionItem item : exceptionItems) {
|
||||
sb.append(item.toString()).append("\r\n");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedMessage() {
|
||||
return getMessage();
|
||||
}
|
||||
|
||||
public As3ScriptReplaceException(As3ScriptReplaceExceptionItem exceptionItem) {
|
||||
this.exceptionItems = new ArrayList<>();
|
||||
this.exceptionItems.add(exceptionItem);
|
||||
|
||||
@@ -41,4 +41,9 @@ public class As3ScriptReplaceExceptionItem {
|
||||
return col;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (file != null ? "" + file : "") + (line != LINE_UNKNOWN ? ("(" + line + ")") : "") + (col != COL_UNKNOWN ? (" col: " + col) : "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ public class FFDecAs3ScriptReplacer implements As3ScriptReplacerInterface {
|
||||
throw new As3ScriptReplaceException(new As3ScriptReplaceExceptionItem(null, ex.text, (int) ex.line));
|
||||
} catch (CompilationException ex) {
|
||||
abc.script_info.get(oldIndex).delete(abc, false);
|
||||
throw new As3ScriptReplaceException(new As3ScriptReplaceExceptionItem(null, ex.text, (int) ex.line));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user