show class name in log message

This commit is contained in:
2015-02-25 23:13:55 +01:00
parent c17b699d58
commit 7e89a2c721
7 changed files with 20 additions and 13 deletions
@@ -207,7 +207,11 @@ public final class MethodBody implements Cloneable {
} catch (InterruptedException ex) {
throw ex;
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", ex);
if (ex instanceof TimeoutException) {
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error in " + path, ex);
} else {
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation timeout in " + path, ex);
}
convertException = ex;
Throwable cause = ex.getCause();
if (ex instanceof ExecutionException && cause instanceof Exception) {
@@ -240,10 +244,10 @@ public final class MethodBody implements Cloneable {
Graph.graphToString(convertedItems, writer, LocalData.create(constants, localRegNames, fullyQualifiedNames));
//writer.endMethod();
} else if (convertException instanceof TimeoutException) {
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", convertException);
// exception was logged in convert method
Helper.appendTimeoutComment(writer, timeout);
} else {
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error", convertException);
// exception was logged in convert method
Helper.appendErrorComment(writer, convertException);
}
}
@@ -163,7 +163,8 @@ public abstract class Trait implements Serializable {
public void convertPackaged(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, NulWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
Namespace ns = abc.constants.getMultiname(name_index).getNamespace(abc.constants);
if ((ns.kind == Namespace.KIND_PACKAGE) || (ns.kind == Namespace.KIND_PACKAGE_INTERNAL)) {
convert(parent, path, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
String nsname = ns.getName(abc.constants, false);
convert(parent, path + nsname, abc, isStatic, exportMode, scriptIndex, classIndex, writer, fullyQualifiedNames, parallel);
}
}
@@ -719,7 +719,11 @@ public abstract class Action implements GraphSourceItem {
} catch (InterruptedException ex) {
throw ex;
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
logger.log(Level.SEVERE, "Decompilation error in: " + path, ex);
if (ex instanceof TimeoutException) {
logger.log(Level.SEVERE, "Decompilation error in: " + path, ex);
} else {
logger.log(Level.SEVERE, "Decompilation timeout in: " + path, ex);
}
convertException = ex;
Throwable cause = ex.getCause();
if (ex instanceof ExecutionException && cause instanceof Exception) {
@@ -734,10 +738,8 @@ public abstract class Action implements GraphSourceItem {
if (convertException == null) {
Graph.graphToString(tree, writer, new LocalData());
} else if (convertException instanceof TimeoutException) {
logger.log(Level.SEVERE, "Decompilation error in: " + path, convertException);
Helper.appendTimeoutComment(writer, timeout);
} else {
logger.log(Level.SEVERE, "Decompilation error in: " + path, convertException);
Helper.appendErrorComment(writer, convertException);
}
if (asm != null) {
@@ -857,7 +857,7 @@ public class Helper {
writer.appendNoHilight(" * ").appendNoHilight(decompilationErrorAdd).newLine();
}
writer.appendNoHilight(" * ").appendNoHilight(AppResources.translate("decompilationError.errorType")).
appendNoHilight(": " + ex.getClass().getSimpleName()).newLine();
appendNoHilight(": " + ex.getClass().getSimpleName() + " (" + ex.getMessage() + ")").newLine();
writer.appendNoHilight(" */").newLine();
writer.appendNoHilight("throw new flash.errors.IllegalOperationError(\"").
appendNoHilight(AppResources.translate("decompilationError.error.description")).