fix: resolve some sonar critical issues
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user