From 74c78b4b285bf4bd9c496c29683963f6cb067641 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Tue, 14 Jul 2015 21:27:37 +0200 Subject: [PATCH] build fix --- .../decompiler/flash/gui/abc/ABCPanel.java | 4 ++-- .../flash/gui/abc/DecompiledEditorPane.java | 17 +++++++++-------- .../abc/tablemodels/NamespaceTableModel.java | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index d7d3dc6a9..abc659f6e 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -480,7 +480,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener("")) != -1; + return decompiledTextArea.getLocalDeclarationOfPos(pos, new Reference<>(null)) != -1; } private void gotoDeclaration(int pos) { @@ -525,7 +525,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener("")); + int dpos = decompiledTextArea.getLocalDeclarationOfPos(pos, new Reference<>(null)); if (dpos > -1) { decompiledTextArea.setCaretPosition(dpos); } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java index 06085ee73..3781adb8f 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java @@ -41,6 +41,7 @@ import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; import com.jpexs.decompiler.flash.tags.ABCContainerTag; +import com.jpexs.decompiler.graph.DottedChain; import java.awt.Point; import java.util.ArrayList; import java.util.List; @@ -250,7 +251,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL return getMultinameAtPos(getCaretPosition()); } - public int getLocalDeclarationOfPos(int pos, Reference type) { + public int getLocalDeclarationOfPos(int pos, Reference type) { Highlighting sh = Highlighting.searchPos(specialHighlights, pos); Highlighting h = Highlighting.searchPos(highlights, pos); @@ -275,7 +276,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL Highlighting ch = Highlighting.searchPos(classHighlights, pos); int cindex = (int) ch.getProperties().index; ABC abc = getABC(); - type.setVal(abc.instance_info.get(cindex).getName(abc.constants).getNameWithNamespace(abc.constants).toString()); + type.setVal(abc.instance_info.get(cindex).getName(abc.constants).getNameWithNamespace(abc.constants)); return ch.startPos; } @@ -329,15 +330,15 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL if (t.type != TokenType.IDENTIFIER && t.type != TokenType.KEYWORD || t.type == TokenType.REGEX) { return false; } - Reference locTypeRef = new Reference<>(""); + Reference locTypeRef = new Reference<>(DottedChain.EMPTY); getLocalDeclarationOfPos(t.start, locTypeRef); - String currentType = locTypeRef.getVal(); - if (currentType.equals("*")) { + DottedChain currentType = locTypeRef.getVal(); + if (currentType.equals(DottedChain.ALL)) { return false; } boolean found; t = sd.getNextToken(t); - while (t != lastToken && !currentType.equals("*")) { + while (t != lastToken && !currentType.equals(DottedChain.ALL)) { t = sd.getNextToken(t); String ident = t.getString(sd); found = false; @@ -356,7 +357,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL traitIndex.setVal(j); classTrait.setVal(false); multinameIndex.setVal(tr.name_index); - currentType = ii.getName(a.constants).getNameWithNamespace(a.constants).toString(); + currentType = ii.getName(a.constants).getNameWithNamespace(a.constants); found = true; break loopi; } @@ -371,7 +372,7 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL traitIndex.setVal(j); classTrait.setVal(true); multinameIndex.setVal(tr.name_index); - currentType = ii.getName(a.constants).getNameWithNamespace(a.constants).toString(); + currentType = ii.getName(a.constants).getNameWithNamespace(a.constants); found = true; break loopi; } diff --git a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java index 21496b776..059537cdc 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/tablemodels/NamespaceTableModel.java @@ -125,7 +125,7 @@ public class NamespaceTableModel implements TableModel { if (rowIndex == 0) { return "-"; } - DottedChain chain = abc.constants.getNamespace(rowIndex).getName(abc.constants, true); + DottedChain chain = abc.constants.getNamespace(rowIndex).getName(abc.constants); if (chain == null) { return "-"; }