Check referencing instance variables from static context.

This commit is contained in:
Jindra Petřík
2025-05-30 23:36:46 +02:00
parent af408060b3
commit df9791ebda
11 changed files with 312 additions and 164 deletions
@@ -1240,6 +1240,9 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
Reference<Integer> multinameIndexRef = new Reference<>(0);
Reference<Boolean> classTrait = new Reference<>(false);
Reference<ABC> usedAbcRef = new Reference<>(null);
if (getSwf() == null) {
return false;
}
if (decompiledTextArea.getPropertyTypeAtPos(getSwf().getAbcIndex(), pos, abcIndex, classIndex, traitIndex, classTrait, multinameIndexRef, usedAbcRef)) {
return true;
}
@@ -156,8 +156,8 @@ public class UsageFrame extends AppDialog implements MouseListener {
};
Main.getMainFrame().getPanel().setLoadingScrollPosEnabled(false);
if (decompiledTextArea.getScriptIndex() == icu.getScriptIndex() &&
(decompiledTextArea.getClassIndex() == icu.getClassIndex() || icu.getClassIndex() == -1) && abcPanel.abc == newAbc) {
if (decompiledTextArea.getScriptIndex() == icu.getScriptIndex()
&& (decompiledTextArea.getClassIndex() == icu.getClassIndex() || icu.getClassIndex() == -1) && abcPanel.abc == newAbc) {
setTrait.run();
} else {
decompiledTextArea.addScriptListener(setTrait);
@@ -362,11 +362,7 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan
return t;
}
return null;
}
public Token getTokenUnderCursor() {
return tokenAtPos(lastCursorPos);
}
}
public void setLinkHandler(LinkHandler linkHandler) {
@@ -491,7 +491,7 @@ public class VariableMarker implements SyntaxComponent, CaretListener, PropertyC
private void editorMouseMoved(MouseEvent e) {
if (pane instanceof LineMarkedEditorPane) {
Token token = ((LineMarkedEditorPane) pane).getTokenUnderCursor();
Token token = ((LineMarkedEditorPane) pane).tokenAtPos(e.getPoint());
if (token != null) {
String err = errors.get(token.start);
pane.setToolTipText(err);