Commit 47917fd5 authored by Skylot's avatar Skylot

fix: resolve some sonar critical issues

parent 0abb51c8
...@@ -34,18 +34,22 @@ public final class EmptyAttrStorage extends AttributeStorage { ...@@ -34,18 +34,22 @@ public final class EmptyAttrStorage extends AttributeStorage {
@Override @Override
public void clear() { public void clear() {
// ignore
} }
@Override @Override
public void remove(AFlag flag) { public void remove(AFlag flag) {
// ignore
} }
@Override @Override
public <T extends IAttribute> void remove(AType<T> type) { public <T extends IAttribute> void remove(AType<T> type) {
// ignore
} }
@Override @Override
public void remove(IAttribute attr) { public void remove(IAttribute attr) {
// ignore
} }
@Override @Override
......
package jadx.core.dex.attributes; package jadx.core.dex.attributes;
public interface IAttribute { public interface IAttribute {
AType<? extends IAttribute> getType(); <T extends IAttribute> AType<T> getType();
} }
package jadx.core.dex.instructions; package jadx.core.dex.instructions;
import jadx.core.dex.nodes.BlockNode;
import jadx.core.utils.InsnUtils; import jadx.core.utils.InsnUtils;
public class GotoNode extends TargetInsnNode { public class GotoNode extends TargetInsnNode {
...@@ -21,15 +20,6 @@ public class GotoNode extends TargetInsnNode { ...@@ -21,15 +20,6 @@ public class GotoNode extends TargetInsnNode {
} }
@Override @Override
public boolean replaceTargetBlock(BlockNode origin, BlockNode replace) {
return false;
}
@Override
public void initBlocks(BlockNode curBlock) {
}
@Override
public String toString() { public String toString() {
return super.toString() + "-> " + InsnUtils.formatOffset(target); return super.toString() + "-> " + InsnUtils.formatOffset(target);
} }
......
...@@ -9,7 +9,10 @@ public abstract class TargetInsnNode extends InsnNode { ...@@ -9,7 +9,10 @@ public abstract class TargetInsnNode extends InsnNode {
super(type, argsCount); super(type, argsCount);
} }
public abstract void initBlocks(BlockNode curBlock); public void initBlocks(BlockNode curBlock) {
}
public abstract boolean replaceTargetBlock(BlockNode origin, BlockNode replace); public boolean replaceTargetBlock(BlockNode origin, BlockNode replace) {
return false;
}
} }
...@@ -276,7 +276,7 @@ public class JadxSettings extends JadxCLIArgs { ...@@ -276,7 +276,7 @@ public class JadxSettings extends JadxCLIArgs {
fromVersion++; fromVersion++;
} }
if (fromVersion == 1) { if (fromVersion == 1) {
setEditorThemePath(EditorTheme.ALL_THEMES[0].getPath()); setEditorThemePath(EditorTheme.getDefaultTheme().getPath());
fromVersion++; fromVersion++;
} }
if (fromVersion == 2) { if (fromVersion == 2) {
......
...@@ -190,7 +190,7 @@ public class JadxSettingsWindow extends JDialog { ...@@ -190,7 +190,7 @@ public class JadxSettingsWindow extends JDialog {
} }
}); });
EditorTheme[] editorThemes = EditorTheme.ALL_THEMES; EditorTheme[] editorThemes = EditorTheme.getAllThemes();
JComboBox<EditorTheme> themesCbx = new JComboBox<>(editorThemes); JComboBox<EditorTheme> themesCbx = new JComboBox<>(editorThemes);
for (EditorTheme theme : editorThemes) { for (EditorTheme theme : editorThemes) {
if (theme.getPath().equals(settings.getEditorThemePath())) { if (theme.getPath().equals(settings.getEditorThemePath())) {
......
...@@ -3,7 +3,7 @@ package jadx.gui.ui.codearea; ...@@ -3,7 +3,7 @@ package jadx.gui.ui.codearea;
public final class EditorTheme { public final class EditorTheme {
private static final String RSTA_THEME_PATH = "/org/fife/ui/rsyntaxtextarea/themes/"; private static final String RSTA_THEME_PATH = "/org/fife/ui/rsyntaxtextarea/themes/";
public static final EditorTheme[] ALL_THEMES = private static final EditorTheme[] ALL_THEMES =
new EditorTheme[]{ new EditorTheme[]{
new EditorTheme("default"), new EditorTheme("default"),
new EditorTheme("eclipse"), new EditorTheme("eclipse"),
...@@ -13,6 +13,14 @@ public final class EditorTheme { ...@@ -13,6 +13,14 @@ public final class EditorTheme {
new EditorTheme("monokai") new EditorTheme("monokai")
}; };
public static EditorTheme[] getAllThemes() {
return ALL_THEMES;
}
public static EditorTheme getDefaultTheme() {
return ALL_THEMES[0];
}
private final String name; private final String name;
private final String path; private final String path;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment