From a92d46505e61fdc85215106e40def62e2d3ff4be Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Fri, 19 Dec 2014 14:56:57 +0100 Subject: [PATCH] =?UTF-8?q?#759=20Decompilation=20=C2=A7=20symbol=20suppos?= =?UTF-8?q?ed=20to=20be=20string=20but=20gets=20in=20class=20name=20fixed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flash/abc/types/MethodInfo.java | 7 +++++- .../flash/gui/abc/UndoFixedEditorPane.java | 22 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java index 24cf1593e..1c68c3853 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/MethodInfo.java @@ -337,7 +337,12 @@ public class MethodInfo { public GraphTextWriter getReturnTypeStr(GraphTextWriter writer, AVM2ConstantPool constants, List fullyQualifiedNames) { String rname = "*"; if (ret_type > 0) { - rname = IdentifiersDeobfuscation.printIdentifier(true, constants.getMultiname(ret_type).getName(constants, fullyQualifiedNames, true), "void"); + Multiname multiname = constants.getMultiname(ret_type); + if (multiname.kind != Multiname.TYPENAME && multiname.name_index > 0 && constants.getString(multiname.name_index).equals("void")) { + rname = "void"; + } else { + rname = multiname.getName(constants, fullyQualifiedNames, false); + } } return writer.hilightSpecial(rname, HighlightSpecialType.RETURNS); } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/UndoFixedEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/UndoFixedEditorPane.java index 6cb216cbb..04e4296c4 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/UndoFixedEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/UndoFixedEditorPane.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.gui.abc; import com.jpexs.decompiler.flash.configuration.Configuration; +import com.jpexs.decompiler.flash.gui.View; import java.awt.event.KeyEvent; import java.io.IOException; import java.io.Reader; @@ -36,10 +37,17 @@ import jsyntaxpane.SyntaxDocument; public class UndoFixedEditorPane extends JEditorPane { private static final Object setTextLock = new Object(); + private String originalContentType; @Override - public void setText(String t) { - setText(t, getContentType()); + public void setText(final String t) { + View.execInEventDispatch(new Runnable() { + + @Override + public void run() { + setText(t, getContentType()); + } + }); } private void setText(String t, String contentType) { @@ -48,12 +56,16 @@ public class UndoFixedEditorPane extends JEditorPane { boolean plain = t.length() > Configuration.syntaxHighlightLimit.get(); if (plain) { contentType = "text/plain"; + originalContentType = getContentType(); + setContentType(contentType); + } else { + if (originalContentType != null) { + setContentType(originalContentType); + originalContentType = null; + } } try { - if (!getContentType().equals(contentType)) { - setContentType(contentType); - } Document doc = getDocument(); setDocument(new SyntaxDocument(null)); doc.remove(0, doc.getLength());