mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-24 13:45:32 +00:00
#102 Fixed highlighting in export
This commit is contained in:
@@ -309,7 +309,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
public String convert(String path, List<ABCContainerTag> abcTags, ABC abc, boolean isStatic, boolean pcode, int scriptIndex, int classIndex, boolean highlight, List<String> fullyQualifiedNames) {
|
||||
|
||||
if (!highlight) {
|
||||
Highlighting.doHighlight = false;
|
||||
//Highlighting.doHighlight = false;
|
||||
}
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
PrintStream out = null;
|
||||
@@ -408,6 +408,9 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
if (bodyIndex != -1) {
|
||||
if (Configuration.DO_DECOMPILE) {
|
||||
bodyStr = abc.bodies[bodyIndex].toString(packageName + "." + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".staticinitializer", pcode, true, scriptIndex, class_info, abc, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), true, highlight, fullyQualifiedNames, abc.class_info[class_info].static_traits);
|
||||
if (!highlight) {
|
||||
bodyStr = Highlighting.stripHilights(bodyStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Highlighting.stripHilights(bodyStr).equals("")) {
|
||||
@@ -444,6 +447,9 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
if (bodyIndex != -1) {
|
||||
if (Configuration.DO_DECOMPILE) {
|
||||
bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(packageName + "." + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants, fullyQualifiedNames) + ".initializer", pcode, false, scriptIndex, class_info, abc, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, highlight, fullyQualifiedNames, abc.instance_info[class_info].instance_traits), 3);
|
||||
if (!highlight) {
|
||||
bodyStr = Highlighting.stripHilights(bodyStr);
|
||||
}
|
||||
}
|
||||
constructorParams = abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(abc.constants, abc.bodies[bodyIndex], abc, fullyQualifiedNames);
|
||||
} else {
|
||||
@@ -485,7 +491,7 @@ public class TraitClass extends Trait implements TraitWithSlot {
|
||||
out.println(bui.toString());
|
||||
out.println(ABC.IDENT_STRING + "}");//class
|
||||
out.flush();
|
||||
Highlighting.doHighlight = true;
|
||||
//Highlighting.doHighlight = true;
|
||||
try {
|
||||
if (highlight) {
|
||||
return Highlighting.hilighClass(new String(baos.toByteArray(), "UTF-8"), class_info);
|
||||
|
||||
@@ -64,11 +64,11 @@ public class TraitMethodGetterSetter extends Trait {
|
||||
String bodyStr = "";
|
||||
int bodyIndex = abc.findBodyIndex(method_info);
|
||||
if ((bodyIndex != -1) && (Configuration.DO_DECOMPILE)) {
|
||||
try{
|
||||
bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames), pcode, isStatic, scriptIndex, classIndex, abc, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, highlight, fullyQualifiedNames, null), 3);
|
||||
}catch(StackOverflowError er){
|
||||
try {
|
||||
bodyStr = ABC.addTabs(abc.bodies[bodyIndex].toString(path + "." + getName(abc).getName(abc.constants, fullyQualifiedNames), pcode, isStatic, scriptIndex, classIndex, abc, abc.constants, abc.method_info, new Stack<GraphTargetItem>(), false, highlight, fullyQualifiedNames, null), 3);
|
||||
} catch (StackOverflowError er) {
|
||||
er.printStackTrace();
|
||||
bodyStr="//StackOverflowError";
|
||||
bodyStr = "//StackOverflowError";
|
||||
}
|
||||
}
|
||||
return ABC.IDENT_STRING + ABC.IDENT_STRING + header + ((classIndex != -1 && abc.instance_info[classIndex].isInterface()) ? ";" : " {\r\n" + bodyStr + "\r\n" + ABC.IDENT_STRING + ABC.IDENT_STRING + "}");
|
||||
|
||||
@@ -128,7 +128,7 @@ public class Traits implements Serializable {
|
||||
Future<String> future = executor.submit(new TraitConvertTask(traits[t], makePackages, path, abcTags, abc, isStatic, pcode, scriptIndex, classIndex, highlighting, fullyQualifiedNames, t));
|
||||
futureResults.add(future);
|
||||
}
|
||||
|
||||
|
||||
for (int f = 0; f < futureResults.size(); f++) {
|
||||
if (f > 0) {
|
||||
s += "\r\n\r\n";
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Highlighting implements Serializable {
|
||||
/**
|
||||
* Turn hignlighting on/off
|
||||
*/
|
||||
public static boolean doHighlight = true;
|
||||
private static boolean doHighlight = true;
|
||||
|
||||
/**
|
||||
* Returns a string representation of the object
|
||||
|
||||
Reference in New Issue
Block a user