#816 P-code not shown after selecting "class initializer" trait fixed

This commit is contained in:
2015-02-26 12:39:41 +01:00
parent 7e89a2c721
commit a11015e90c
9 changed files with 43 additions and 38 deletions
@@ -138,8 +138,13 @@ public class ScriptPack extends AS3ClassTreeItem {
}
}
public void appendTo(GraphTextWriter writer, List<Trait> traits, ScriptExportMode exportMode, boolean parallel) throws InterruptedException {
private void appendTo(GraphTextWriter writer, List<Trait> traits, ScriptExportMode exportMode, boolean parallel) throws InterruptedException {
boolean first = true;
for (int t : traitIndices) {
if (!first) {
writer.newLine();
}
Trait trait = traits.get(t);
Multiname name = trait.getName(abc);
Namespace ns = name.getNamespace(abc.constants);
@@ -148,6 +153,8 @@ public class ScriptPack extends AS3ClassTreeItem {
} else {
trait.toString(null, "", abc, false, exportMode, scriptIndex, -1, writer, new ArrayList<String>(), parallel);
}
first = false;
}
}
@@ -208,9 +208,9 @@ public final class MethodBody implements Cloneable {
throw ex;
} catch (Exception | OutOfMemoryError | StackOverflowError 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);
} else {
Logger.getLogger(MethodBody.class.getName()).log(Level.SEVERE, "Decompilation error in " + path, ex);
}
convertException = ex;
Throwable cause = ex.getCause();
@@ -361,7 +361,6 @@ public class TraitClass extends Trait implements TraitWithSlot {
@Override
public GraphTextWriter toString(Trait parent, String path, ABC abc, boolean isStatic, ScriptExportMode exportMode, int scriptIndex, int classIndex, GraphTextWriter writer, List<String> fullyQualifiedNames, boolean parallel) throws InterruptedException {
writer.startClass(class_info);
String packageName = abc.instance_info.get(class_info).getName(abc.constants).getNamespace(abc.constants).getName(abc.constants, false); //assume not null name
List<String> namesInThisPackage = new ArrayList<>();
for (ABCContainerTag tag : abc.getAbcTags()) {
@@ -448,6 +447,8 @@ public class TraitClass extends Trait implements TraitWithSlot {
writer.newLine();
}
writer.startClass(class_info);
//class header
abc.instance_info.get(class_info).getClassHeaderStr(writer, abc, fullyQualifiedNames, false);
writer.startBlock();
@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -1,16 +1,16 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
@@ -720,9 +720,9 @@ public abstract class Action implements GraphSourceItem {
throw ex;
} catch (Exception | OutOfMemoryError | StackOverflowError ex) {
if (ex instanceof TimeoutException) {
logger.log(Level.SEVERE, "Decompilation error in: " + path, ex);
} else {
logger.log(Level.SEVERE, "Decompilation timeout in: " + path, ex);
} else {
logger.log(Level.SEVERE, "Decompilation error in: " + path, ex);
}
convertException = ex;
Throwable cause = ex.getCause();