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 {
@Override
public void clear() {
// ignore
}
@Override
public void remove(AFlag flag) {
// ignore
}
@Override
public <T extends IAttribute> void remove(AType<T> type) {
// ignore
}
@Override
public void remove(IAttribute attr) {
// ignore
}
@Override
......
package jadx.core.dex.attributes;
public interface IAttribute {
AType<? extends IAttribute> getType();
<T extends IAttribute> AType<T> getType();
}
package jadx.core.dex.instructions;
import jadx.core.dex.nodes.BlockNode;
import jadx.core.utils.InsnUtils;
public class GotoNode extends TargetInsnNode {
......@@ -21,15 +20,6 @@ public class GotoNode extends TargetInsnNode {
}
@Override
public boolean replaceTargetBlock(BlockNode origin, BlockNode replace) {
return false;
}
@Override
public void initBlocks(BlockNode curBlock) {
}
@Override
public String toString() {
return super.toString() + "-> " + InsnUtils.formatOffset(target);
}
......
......@@ -9,7 +9,10 @@ public abstract class TargetInsnNode extends InsnNode {
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 {
fromVersion++;
}
if (fromVersion == 1) {
setEditorThemePath(EditorTheme.ALL_THEMES[0].getPath());
setEditorThemePath(EditorTheme.getDefaultTheme().getPath());
fromVersion++;
}
if (fromVersion == 2) {
......
......@@ -190,7 +190,7 @@ public class JadxSettingsWindow extends JDialog {
}
});
EditorTheme[] editorThemes = EditorTheme.ALL_THEMES;
EditorTheme[] editorThemes = EditorTheme.getAllThemes();
JComboBox<EditorTheme> themesCbx = new JComboBox<>(editorThemes);
for (EditorTheme theme : editorThemes) {
if (theme.getPath().equals(settings.getEditorThemePath())) {
......
......@@ -3,7 +3,7 @@ package jadx.gui.ui.codearea;
public final class EditorTheme {
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("default"),
new EditorTheme("eclipse"),
......@@ -13,6 +13,14 @@ public final class EditorTheme {
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 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