Skip to content

Commit

Permalink
chore: resolve warnings in SmaliArea class
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed Oct 16, 2024
1 parent 2674133 commit 742d30d
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions jadx-gui/src/main/java/jadx/gui/ui/codearea/SmaliArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ public final class SmaliArea extends AbstractCodeArea {

setCodeFoldingEnabled(true);

cbUseSmaliV2 = new JCheckBoxMenuItem(NLS.str("popup.bytecode_col"),
shouldUseSmaliPrinterV2());
cbUseSmaliV2 = new JCheckBoxMenuItem(NLS.str("popup.bytecode_col"), shouldUseSmaliPrinterV2());
cbUseSmaliV2.setAction(new AbstractAction(NLS.str("popup.bytecode_col")) {
private static final long serialVersionUID = -1111111202103170737L;

Expand Down Expand Up @@ -116,7 +115,7 @@ public JNode getNode() {
}

public JClass getJClass() {
return ((JClass) node);
return (JClass) node;
}

private void switchModel() {
Expand All @@ -127,8 +126,8 @@ private void switchModel() {
}

public void scrollToDebugPos(int pos) {
getContentPanel().getMainWindow()
.getSettings().setSmaliAreaShowBytecode(true); // don't sync when it's set programmatically.
// don't sync when it's set programmatically.
getContentPanel().getMainWindow().getSettings().setSmaliAreaShowBytecode(true);
cbUseSmaliV2.setState(shouldUseSmaliPrinterV2());
if (!(model instanceof DebugModel)) {
switchModel();
Expand Down Expand Up @@ -195,7 +194,6 @@ public void unload() {

private class DebugModel extends SmaliModel {
private KeyStroke bpShortcut;
private final String keyID = "set a break point";
private Gutter gutter;
private Object runningHighlightTag = null; // running line
private final SmaliV2Style smaliV2Style = new SmaliV2Style(SmaliArea.this);
Expand Down Expand Up @@ -231,11 +229,9 @@ public void load() {
public void unload() {
removePropertyChangeListener(listener);
removeLineHighlight(runningHighlightTag);
UiUtils.removeKeyBinding(SmaliArea.this, bpShortcut, keyID);
UiUtils.removeKeyBinding(SmaliArea.this, bpShortcut, "set a break point");
BreakpointManager.removeListener((JClass) node);
bpMap.forEach((k, v) -> {
v.remove();
});
bpMap.forEach((k, v) -> v.remove());
}

@Override
Expand Down Expand Up @@ -318,7 +314,6 @@ private void setBreakpointDisabled(int pos) {
}

private class SmaliV2Style extends SyntaxScheme {

Theme curTheme;

public SmaliV2Style(SmaliArea smaliArea) {
Expand Down Expand Up @@ -364,7 +359,7 @@ public void restoreDefaults(Font baseFont) {

@Override
public void restoreDefaults(Font baseFont, boolean fontStyles) {
// Note: it's a hook for continue using the editor theme, better don't remove it.
// Note: it's a hook for continuing using the editor theme, better don't remove it.
}
}

Expand Down Expand Up @@ -430,7 +425,7 @@ public IconRowHeader createIconRowHeader(RTextArea textArea) {

@Override
public void mousePressed(MouseEvent e) {
int offs = textArea.viewToModel(e.getPoint());
int offs = textArea.viewToModel2D(e.getPoint());
if (offs > -1) {
model.setBreakpoint(offs);
}
Expand Down

0 comments on commit 742d30d

Please sign in to comment.