diff --git a/app/src/main/java/io/xpipe/app/beacon/BeaconRequestHandler.java b/app/src/main/java/io/xpipe/app/beacon/BeaconRequestHandler.java index 0a391696d..9b3a55416 100644 --- a/app/src/main/java/io/xpipe/app/beacon/BeaconRequestHandler.java +++ b/app/src/main/java/io/xpipe/app/beacon/BeaconRequestHandler.java @@ -193,7 +193,7 @@ public class BeaconRequestHandler implements HttpHandler { && method.getParameters()[0].getType().equals(byte[].class)) .findFirst() .orElseThrow(); - setMethod.invoke(b, s); + setMethod.invoke(b, (Object) s); var m = b.getClass().getDeclaredMethod("build"); m.setAccessible(true); diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java index 820a3ebfb..a8a4b08fc 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java @@ -4,7 +4,6 @@ import io.xpipe.app.browser.action.BrowserAction; import io.xpipe.app.comp.SimpleComp; import io.xpipe.app.core.AppI18n; import io.xpipe.app.util.*; -import io.xpipe.app.util.PlatformThread; import io.xpipe.core.process.OsType; import io.xpipe.core.store.FileEntry; import io.xpipe.core.store.FileInfo; diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabModel.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabModel.java index febf548ca..d8d239915 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabModel.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabModel.java @@ -585,11 +585,11 @@ public final class BrowserFileSystemTabModel extends BrowserStoreSessionTab { return new Structure(pane, multiR, sidebarR, new ArrayList<>(multiR.getChildren())); } - public static record Structure(BorderPane pane, StackPane stack, Region sidebar, List children) implements CompStructure { + public record Structure(BorderPane pane, StackPane stack, Region sidebar, List children) + implements CompStructure { public void prepareAddition() { stack.getChildren().clear(); diff --git a/app/src/main/java/io/xpipe/app/comp/base/AppMainWindowContentComp.java b/app/src/main/java/io/xpipe/app/comp/base/AppMainWindowContentComp.java index 6c72c2824..3e25bc1b7 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/AppMainWindowContentComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/AppMainWindowContentComp.java @@ -19,12 +19,9 @@ import javafx.scene.layout.Region; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; -import javafx.util.Duration; import atlantafx.base.util.Animations; -import java.time.Instant; - public class AppMainWindowContentComp extends SimpleComp { private final Stage stage; diff --git a/app/src/main/java/io/xpipe/app/comp/base/MarkdownComp.java b/app/src/main/java/io/xpipe/app/comp/base/MarkdownComp.java index ef8575fea..6da09a31b 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/MarkdownComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/MarkdownComp.java @@ -42,7 +42,8 @@ public class MarkdownComp extends Comp> { this.bodyPadding = bodyPadding; } - public MarkdownComp(ObservableValue markdown, UnaryOperator htmlTransformation, boolean bodyPadding) { + public MarkdownComp( + ObservableValue markdown, UnaryOperator htmlTransformation, boolean bodyPadding) { this.markdown = markdown; this.htmlTransformation = htmlTransformation; this.bodyPadding = bodyPadding; diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java index 840afe045..27e7e6648 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java @@ -137,8 +137,7 @@ public abstract class StoreEntryComp extends SimpleComp { .augment(button); var loading = LoadingOverlayComp.noProgress( - Comp.of(() -> button), - getWrapper().getEffectiveBusy()); + Comp.of(() -> button), getWrapper().getEffectiveBusy()); AppFont.normal(button); return loading.createRegion(); } diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreEntryWrapper.java b/app/src/main/java/io/xpipe/app/comp/store/StoreEntryWrapper.java index 13d49ceee..c21961580 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreEntryWrapper.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreEntryWrapper.java @@ -14,9 +14,7 @@ import io.xpipe.core.store.DataStore; import io.xpipe.core.store.SingletonSessionStore; import javafx.beans.binding.Bindings; -import javafx.beans.binding.BooleanBinding; import javafx.beans.property.*; -import javafx.beans.value.ObservableBooleanValue; import javafx.beans.value.ObservableStringValue; import javafx.collections.FXCollections; diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreNotesComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreNotesComp.java index 008ba28b4..a5af7873d 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreNotesComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreNotesComp.java @@ -15,7 +15,6 @@ import javafx.application.Platform; import javafx.beans.property.Property; import javafx.beans.property.SimpleStringProperty; import javafx.event.ActionEvent; -import javafx.geometry.Insets; import javafx.scene.control.Button; import javafx.scene.paint.Color; diff --git a/app/src/main/java/io/xpipe/app/core/AppArguments.java b/app/src/main/java/io/xpipe/app/core/AppArguments.java index 684f4a1de..45bb2c314 100644 --- a/app/src/main/java/io/xpipe/app/core/AppArguments.java +++ b/app/src/main/java/io/xpipe/app/core/AppArguments.java @@ -107,7 +107,7 @@ public class AppArguments { } @Override - public Integer call() throws Exception { + public Integer call() { return 0; } } diff --git a/app/src/main/java/io/xpipe/app/core/AppFont.java b/app/src/main/java/io/xpipe/app/core/AppFont.java index 341676a36..dffd97341 100644 --- a/app/src/main/java/io/xpipe/app/core/AppFont.java +++ b/app/src/main/java/io/xpipe/app/core/AppFont.java @@ -8,7 +8,6 @@ import javafx.scene.Node; import javafx.scene.text.Font; import org.kordamp.ikonli.javafx.FontIcon; -import org.kordamp.ikonli.javafx.IkonResolver; import java.nio.file.FileVisitResult; import java.nio.file.Files; diff --git a/app/src/main/java/io/xpipe/app/core/AppLayoutModel.java b/app/src/main/java/io/xpipe/app/core/AppLayoutModel.java index b8b860370..722b00ffa 100644 --- a/app/src/main/java/io/xpipe/app/core/AppLayoutModel.java +++ b/app/src/main/java/io/xpipe/app/core/AppLayoutModel.java @@ -39,7 +39,7 @@ public class AppLayoutModel { public AppLayoutModel(SavedState savedState) { this.savedState = savedState; this.entries = createEntryList(); - this.selected = new SimpleObjectProperty<>(entries.get(0)); + this.selected = new SimpleObjectProperty<>(entries.getFirst()); } public static AppLayoutModel get() { @@ -73,7 +73,7 @@ public class AppLayoutModel { } public void selectConnections() { - selected.setValue(entries.get(0)); + selected.setValue(entries.getFirst()); } private List createEntryList() { diff --git a/app/src/main/java/io/xpipe/app/core/check/AppAvCheck.java b/app/src/main/java/io/xpipe/app/core/check/AppAvCheck.java index dab965efc..4db34af55 100644 --- a/app/src/main/java/io/xpipe/app/core/check/AppAvCheck.java +++ b/app/src/main/java/io/xpipe/app/core/check/AppAvCheck.java @@ -28,7 +28,7 @@ public class AppAvCheck { return Optional.empty(); } - public static void check() throws Throwable { + public static void check() { // Only show this on first launch on windows if (OsType.getLocal() != OsType.WINDOWS || !AppProperties.get().isInitialLaunch()) { return; @@ -42,16 +42,19 @@ public class AppAvCheck { var modal = ModalOverlay.of(Comp.of(() -> { AtomicReference markdown = new AtomicReference<>(); AppResources.with(AppResources.XPIPE_MODULE, "misc/antivirus.md", file -> { - markdown.set(new MarkdownComp(Files.readString(file), s -> { - var t = found.get(); - return s.formatted( - t.getName(), - t.getName(), - t.getDescription(), - AppProperties.get().getVersion(), - AppProperties.get().getVersion(), - t.getName()); - }, false) + markdown.set(new MarkdownComp( + Files.readString(file), + s -> { + var t = found.get(); + return s.formatted( + t.getName(), + t.getName(), + t.getDescription(), + AppProperties.get().getVersion(), + AppProperties.get().getVersion(), + t.getName()); + }, + false) .prefWidth(550) .prefHeight(600) .createRegion()); diff --git a/app/src/main/java/io/xpipe/app/core/check/AppShellChecker.java b/app/src/main/java/io/xpipe/app/core/check/AppShellChecker.java index 2713f1929..2ac166255 100644 --- a/app/src/main/java/io/xpipe/app/core/check/AppShellChecker.java +++ b/app/src/main/java/io/xpipe/app/core/check/AppShellChecker.java @@ -6,8 +6,6 @@ import io.xpipe.app.util.LocalShell; import io.xpipe.app.util.ScriptHelper; import io.xpipe.core.process.ProcessOutputException; -import io.xpipe.core.process.ShellDialect; -import io.xpipe.core.process.ShellDialects; import lombok.Value; import java.util.Optional; @@ -88,7 +86,8 @@ public abstract class AppShellChecker { var scriptFile = ScriptHelper.getExecScriptFile(sc); var scriptContent = sc.getShellDialect().prepareScriptContent("echo test"); sc.view().writeScriptFile(scriptFile, scriptContent); - var out = sc.command(sc.getShellDialect().runScriptCommand(sc, scriptFile.toString())).readStdoutOrThrow(); + var out = sc.command(sc.getShellDialect().runScriptCommand(sc, scriptFile.toString())) + .readStdoutOrThrow(); if (!out.equals("test")) { return Optional.of(new FailureResult( "Expected output \"test\", got output \"" + out + "\" when running test script", true)); diff --git a/app/src/main/java/io/xpipe/app/core/mode/PlatformMode.java b/app/src/main/java/io/xpipe/app/core/mode/PlatformMode.java index 21f1ca4b6..327954c50 100644 --- a/app/src/main/java/io/xpipe/app/core/mode/PlatformMode.java +++ b/app/src/main/java/io/xpipe/app/core/mode/PlatformMode.java @@ -1,6 +1,5 @@ package io.xpipe.app.core.mode; -import io.xpipe.app.core.*; import io.xpipe.app.util.PlatformInit; public abstract class PlatformMode extends OperationMode { diff --git a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java index bb527a610..a0996f894 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java @@ -25,7 +25,6 @@ import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import javafx.scene.input.KeyCombination; import javafx.scene.input.KeyEvent; -import javafx.scene.layout.Region; import javafx.scene.paint.Color; import javafx.stage.Screen; import javafx.stage.Stage; diff --git a/app/src/main/java/io/xpipe/app/ext/DataStoreUsageCategory.java b/app/src/main/java/io/xpipe/app/ext/DataStoreUsageCategory.java index a4bdfe80e..a107182cd 100644 --- a/app/src/main/java/io/xpipe/app/ext/DataStoreUsageCategory.java +++ b/app/src/main/java/io/xpipe/app/ext/DataStoreUsageCategory.java @@ -18,5 +18,5 @@ public enum DataStoreUsageCategory { @JsonProperty("serial") SERIAL, @JsonProperty("identity") - IDENTITY; + IDENTITY } diff --git a/app/src/main/java/io/xpipe/app/ext/LocalStore.java b/app/src/main/java/io/xpipe/app/ext/LocalStore.java index 7955d4978..d860116d9 100644 --- a/app/src/main/java/io/xpipe/app/ext/LocalStore.java +++ b/app/src/main/java/io/xpipe/app/ext/LocalStore.java @@ -23,7 +23,7 @@ public class LocalStore implements NetworkTunnelStore, ShellStore, StatefulDataS public ShellControlFunction shellFunction() { return new ShellControlFunction() { @Override - public ShellControl control() throws Exception { + public ShellControl control() { var pc = ProcessControlProvider.get().createLocalProcessControl(true); pc.withSourceStore(LocalStore.this); pc.withShellStateInit(LocalStore.this); @@ -39,7 +39,7 @@ public class LocalStore implements NetworkTunnelStore, ShellStore, StatefulDataS } @Override - public NetworkTunnelSession createTunnelSession(int localPort, int remotePort, String address) throws Exception { + public NetworkTunnelSession createTunnelSession(int localPort, int remotePort, String address) { throw new UnsupportedOperationException(); } } diff --git a/app/src/main/java/io/xpipe/app/ext/UserScopeStore.java b/app/src/main/java/io/xpipe/app/ext/UserScopeStore.java index ff663cb5f..e5c9823b9 100644 --- a/app/src/main/java/io/xpipe/app/ext/UserScopeStore.java +++ b/app/src/main/java/io/xpipe/app/ext/UserScopeStore.java @@ -2,5 +2,5 @@ package io.xpipe.app.ext; public interface UserScopeStore { - public boolean isPerUser(); + boolean isPerUser(); } diff --git a/app/src/main/java/io/xpipe/app/prefs/PasswordManagerCategory.java b/app/src/main/java/io/xpipe/app/prefs/PasswordManagerCategory.java index 67c03e46d..f147d8f3f 100644 --- a/app/src/main/java/io/xpipe/app/prefs/PasswordManagerCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/PasswordManagerCategory.java @@ -52,13 +52,17 @@ public class PasswordManagerCategory extends AppPrefsCategory { choices.add(new Choice( externalPasswordManagerTemplate.getId(), externalPasswordManagerTemplate.getTemplate(), - externalPasswordManagerTemplate.getDocsLink(), + externalPasswordManagerTemplate.getDocsLink(), ExternalPasswordManager.COMMAND)); }); ExternalPasswordManager.ALL.stream() .filter(externalPasswordManager -> externalPasswordManager != ExternalPasswordManager.COMMAND) .forEach(externalPasswordManager -> { - choices.add(new Choice(externalPasswordManager.getId(), null, externalPasswordManager.getDocsLink(), externalPasswordManager)); + choices.add(new Choice( + externalPasswordManager.getId(), + null, + externalPasswordManager.getDocsLink(), + externalPasswordManager)); }); var prefs = AppPrefs.get(); @@ -84,12 +88,13 @@ public class PasswordManagerCategory extends AppPrefsCategory { }; var docsLinkProperty = new SimpleStringProperty(); - var docsLinkButton = new ButtonComp(AppI18n.observable("documentation"), new FontIcon("mdi2h-help-circle-outline"), () -> { - var l = docsLinkProperty.get(); - if (l != null) { - Hyperlinks.open(l); - } - }); + var docsLinkButton = + new ButtonComp(AppI18n.observable("documentation"), new FontIcon("mdi2h-help-circle-outline"), () -> { + var l = docsLinkProperty.get(); + if (l != null) { + Hyperlinks.open(l); + } + }); docsLinkButton.disable(docsLinkProperty.isNull()); var command = new IntegratedTextAreaComp( diff --git a/app/src/main/java/io/xpipe/app/prefs/SupportedLocale.java b/app/src/main/java/io/xpipe/app/prefs/SupportedLocale.java index 2fe551e8a..1a31c6944 100644 --- a/app/src/main/java/io/xpipe/app/prefs/SupportedLocale.java +++ b/app/src/main/java/io/xpipe/app/prefs/SupportedLocale.java @@ -16,7 +16,7 @@ import java.util.Locale; @Getter public class SupportedLocale implements PrefsChoiceValue { - public static List ALL = AppProperties.get().getLanguages().stream() + public static final List ALL = AppProperties.get().getLanguages().stream() .map(s -> { var split = s.split("-"); var loc = split.length == 2 ? Locale.of(split[0], split[1]) : Locale.of(s); diff --git a/app/src/main/java/io/xpipe/app/prefs/WorkspaceCreationAlert.java b/app/src/main/java/io/xpipe/app/prefs/WorkspaceCreationAlert.java index 9ed67d805..0be4f6af9 100644 --- a/app/src/main/java/io/xpipe/app/prefs/WorkspaceCreationAlert.java +++ b/app/src/main/java/io/xpipe/app/prefs/WorkspaceCreationAlert.java @@ -21,7 +21,7 @@ public class WorkspaceCreationAlert { }); } - private static void show() throws Exception { + private static void show() { var name = new SimpleObjectProperty<>("New workspace"); var path = new SimpleObjectProperty<>(AppProperties.get().getDataDir()); var content = new OptionsBuilder() diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorage.java b/app/src/main/java/io/xpipe/app/storage/DataStorage.java index 0736a22c6..02ef602eb 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorage.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorage.java @@ -177,8 +177,8 @@ public abstract class DataStorage { } if (getStoreCategoryIfPresent(PREDEFINED_SCRIPTS_CATEGORY_UUID).isEmpty()) { - var cat = DataStoreCategory.createNew( - ALL_SCRIPTS_CATEGORY_UUID, PREDEFINED_SCRIPTS_CATEGORY_UUID, "Samples"); + var cat = + DataStoreCategory.createNew(ALL_SCRIPTS_CATEGORY_UUID, PREDEFINED_SCRIPTS_CATEGORY_UUID, "Samples"); cat.setDirectory(categoriesDir.resolve(PREDEFINED_SCRIPTS_CATEGORY_UUID.toString())); storeCategories.add(cat); } @@ -296,7 +296,7 @@ public abstract class DataStorage { && storeCategories.stream() .filter(dataStoreCategory -> !dataStoreCategory.getUuid().equals(SYNCED_IDENTITIES_CATEGORY_UUID)) - .allMatch(dataStoreCategory -> !shouldSync(dataStoreCategory))) { + .noneMatch(dataStoreCategory -> shouldSync(dataStoreCategory))) { return false; } @@ -454,10 +454,9 @@ public abstract class DataStorage { e.incrementBusyCounter(); List> newChildren; try { - newChildren = ((FixedHierarchyStore) h) - .listChildren().stream() - .filter(dataStoreEntryRef -> dataStoreEntryRef != null && dataStoreEntryRef.get() != null) - .toList(); + newChildren = h.listChildren().stream() + .filter(dataStoreEntryRef -> dataStoreEntryRef != null && dataStoreEntryRef.get() != null) + .toList(); } catch (Exception ex) { if (throwOnFail) { throw ex; @@ -766,9 +765,11 @@ public abstract class DataStorage { return false; } - if (cat.getUuid().equals(DEFAULT_CATEGORY_UUID) || cat.getUuid().equals(PREDEFINED_SCRIPTS_CATEGORY_UUID) || cat.getUuid().equals( - LOCAL_IDENTITIES_CATEGORY_UUID) || cat.getUuid().equals(CUSTOM_SCRIPTS_CATEGORY_UUID) || cat.getUuid().equals( - SYNCED_IDENTITIES_CATEGORY_UUID)) { + if (cat.getUuid().equals(DEFAULT_CATEGORY_UUID) + || cat.getUuid().equals(PREDEFINED_SCRIPTS_CATEGORY_UUID) + || cat.getUuid().equals(LOCAL_IDENTITIES_CATEGORY_UUID) + || cat.getUuid().equals(CUSTOM_SCRIPTS_CATEGORY_UUID) + || cat.getUuid().equals(SYNCED_IDENTITIES_CATEGORY_UUID)) { return false; } diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorageUserHandler.java b/app/src/main/java/io/xpipe/app/storage/DataStorageUserHandler.java index 735448a2c..d44f44a45 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorageUserHandler.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorageUserHandler.java @@ -20,7 +20,7 @@ public interface DataStorageUserHandler { SecretKey getEncryptionKey(); - public Comp createOverview(); + Comp createOverview(); String getActiveUser(); } diff --git a/app/src/main/java/io/xpipe/app/storage/DataStoreEntryRef.java b/app/src/main/java/io/xpipe/app/storage/DataStoreEntryRef.java index 818692233..9edc672da 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStoreEntryRef.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStoreEntryRef.java @@ -46,7 +46,7 @@ public class DataStoreEntryRef { } @SuppressWarnings("unchecked") - public DataStoreEntryRef asNeeded() { - return (DataStoreEntryRef) this; + public DataStoreEntryRef asNeeded() { + return (DataStoreEntryRef) this; } } diff --git a/app/src/main/java/io/xpipe/app/terminal/GnomeTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/GnomeTerminalType.java index a4f1a1517..1a6b4f663 100644 --- a/app/src/main/java/io/xpipe/app/terminal/GnomeTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/GnomeTerminalType.java @@ -47,5 +47,4 @@ public class GnomeTerminalType extends ExternalTerminalType.PathCheckType implem pc.executeSimpleCommand(toExecute); } } - } diff --git a/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchResult.java b/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchResult.java index fbaee752a..d7e0cb007 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchResult.java +++ b/app/src/main/java/io/xpipe/app/terminal/TerminalLaunchResult.java @@ -7,12 +7,12 @@ import java.nio.file.Path; public interface TerminalLaunchResult { @Value - public static class ResultSuccess implements TerminalLaunchResult { + class ResultSuccess implements TerminalLaunchResult { Path targetScript; } @Value - public static class ResultFailure implements TerminalLaunchResult { + class ResultFailure implements TerminalLaunchResult { Throwable throwable; } } diff --git a/app/src/main/java/io/xpipe/app/terminal/TerminalLauncherManager.java b/app/src/main/java/io/xpipe/app/terminal/TerminalLauncherManager.java index 8def58e9d..8a97d0aa0 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TerminalLauncherManager.java +++ b/app/src/main/java/io/xpipe/app/terminal/TerminalLauncherManager.java @@ -34,8 +34,7 @@ public class TerminalLauncherManager { } public static CountDownLatch submitAsync( - UUID request, ProcessControl processControl, TerminalInitScriptConfig config, String directory) - throws BeaconClientException { + UUID request, ProcessControl processControl, TerminalInitScriptConfig config, String directory) { synchronized (entries) { var req = entries.get(request); if (req == null) { diff --git a/app/src/main/java/io/xpipe/app/terminal/TerminalOpenFormat.java b/app/src/main/java/io/xpipe/app/terminal/TerminalOpenFormat.java index d7500a02e..03dedfe18 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TerminalOpenFormat.java +++ b/app/src/main/java/io/xpipe/app/terminal/TerminalOpenFormat.java @@ -3,5 +3,5 @@ package io.xpipe.app.terminal; public enum TerminalOpenFormat { NEW_WINDOW, TABBED, - NEW_WINDOW_OR_TABBED; + NEW_WINDOW_OR_TABBED } diff --git a/app/src/main/java/io/xpipe/app/terminal/TerminalView.java b/app/src/main/java/io/xpipe/app/terminal/TerminalView.java index c210c5cda..1f3691286 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TerminalView.java +++ b/app/src/main/java/io/xpipe/app/terminal/TerminalView.java @@ -47,19 +47,15 @@ public class TerminalView { } } - public static interface Listener { + public interface Listener { default void onSessionOpened(ShellSession session) {} - ; default void onSessionClosed(ShellSession session) {} - ; default void onTerminalOpened(TerminalSession instance) {} - ; default void onTerminalClosed(TerminalSession instance) {} - ; } private final List sessions = new ArrayList<>(); diff --git a/app/src/main/java/io/xpipe/app/terminal/TrackableTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/TrackableTerminalType.java index a2bdcf2f1..fd0ad0e43 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TrackableTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/TrackableTerminalType.java @@ -2,7 +2,7 @@ package io.xpipe.app.terminal; public interface TrackableTerminalType { - public default int getProcessHierarchyOffset() { + default int getProcessHierarchyOffset() { return 0; } } diff --git a/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java index 81f270506..fd0eaa915 100644 --- a/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java @@ -26,9 +26,9 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm ExternalTerminalType WINDOWS_TERMINAL_PREVIEW = new Preview(); ExternalTerminalType WINDOWS_TERMINAL_CANARY = new Canary(); - static AtomicInteger windowCounter = new AtomicInteger(2); + AtomicInteger windowCounter = new AtomicInteger(2); - private static CommandBuilder toCommand(TerminalLaunchConfiguration configuration) throws Exception { + private static CommandBuilder toCommand(TerminalLaunchConfiguration configuration) { var cmd = CommandBuilder.of() .addIf(configuration.isPreferTabs(), "-w", "1", "nt") .addIf(!configuration.isPreferTabs(), "-w", "" + windowCounter.getAndIncrement()); diff --git a/app/src/main/java/io/xpipe/app/util/AppJacksonModule.java b/app/src/main/java/io/xpipe/app/util/AppJacksonModule.java index ec3a5b00f..b9b15107b 100644 --- a/app/src/main/java/io/xpipe/app/util/AppJacksonModule.java +++ b/app/src/main/java/io/xpipe/app/util/AppJacksonModule.java @@ -87,7 +87,7 @@ public class AppJacksonModule extends SimpleModule { // Preserve same output if not changed if (value.getOriginalNode() != null && !value.requiresRewrite()) { - tree.set("secret", (JsonNode) value.getOriginalNode()); + tree.set("secret", value.getOriginalNode()); jgen.writeTree(tree); return; } diff --git a/app/src/main/java/io/xpipe/app/util/FileReference.java b/app/src/main/java/io/xpipe/app/util/FileReference.java index 87d55fb81..170473d96 100644 --- a/app/src/main/java/io/xpipe/app/util/FileReference.java +++ b/app/src/main/java/io/xpipe/app/util/FileReference.java @@ -35,7 +35,7 @@ public class FileReference { return new FileReference(DataStorage.get().local().ref(), p); } - public final boolean isLocal() { + public boolean isLocal() { return fileSystem.getStore() instanceof LocalStore; } } diff --git a/app/src/main/java/io/xpipe/app/util/LicensedFeature.java b/app/src/main/java/io/xpipe/app/util/LicensedFeature.java index e253b945d..7252a3484 100644 --- a/app/src/main/java/io/xpipe/app/util/LicensedFeature.java +++ b/app/src/main/java/io/xpipe/app/util/LicensedFeature.java @@ -12,11 +12,11 @@ public interface LicensedFeature { ObservableValue suffixObservable(ObservableValue s); - public default ObservableValue suffixObservable(String key) { + default ObservableValue suffixObservable(String key) { return suffixObservable(AppI18n.observable(key)); } - public default String suffix(String s) { + default String suffix(String s) { return getDescriptionSuffix().map(suffix -> s + " (" + suffix + "+)").orElse(s); } diff --git a/app/src/main/java/io/xpipe/app/util/PlatformState.java b/app/src/main/java/io/xpipe/app/util/PlatformState.java index d6f4c7c53..ae87c201f 100644 --- a/app/src/main/java/io/xpipe/app/util/PlatformState.java +++ b/app/src/main/java/io/xpipe/app/util/PlatformState.java @@ -3,7 +3,6 @@ package io.xpipe.app.util; import io.xpipe.app.core.check.AppSystemFontCheck; import io.xpipe.app.core.window.ModifiedStage; import io.xpipe.app.issue.ErrorEvent; -import io.xpipe.app.issue.TrackEvent; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.core.process.OsType; @@ -15,7 +14,6 @@ import lombok.Setter; import org.apache.commons.lang3.SystemUtils; import java.awt.*; -import java.io.IOException; import java.util.concurrent.CountDownLatch; public enum PlatformState { diff --git a/app/src/main/java/io/xpipe/app/util/RdpConfig.java b/app/src/main/java/io/xpipe/app/util/RdpConfig.java index 220483f3a..2f648f162 100644 --- a/app/src/main/java/io/xpipe/app/util/RdpConfig.java +++ b/app/src/main/java/io/xpipe/app/util/RdpConfig.java @@ -71,7 +71,7 @@ public class RdpConfig { } public RdpConfig withRemoved(String key) { - var map = new LinkedHashMap(content); + var map = new LinkedHashMap<>(content); map.remove(key); return new RdpConfig(map); } diff --git a/app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategyHelper.java b/app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategyHelper.java index 1989fdeae..ed819809a 100644 --- a/app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategyHelper.java +++ b/app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategyHelper.java @@ -37,8 +37,12 @@ public class SecretRetrievalStrategyHelper { var changed = !Arrays.equals( newSecret != null ? newSecret.getSecret() : new char[0], original != null ? original.getSecret() : new char[0]); - var val = changed ? (allowUserSecretKey ? DataStorageSecret.ofCurrentSecret(secretProperty.getValue()) : - DataStorageSecret.ofSecret(secretProperty.getValue(), EncryptionToken.ofVaultKey())) : original; + var val = changed + ? (allowUserSecretKey + ? DataStorageSecret.ofCurrentSecret(secretProperty.getValue()) + : DataStorageSecret.ofSecret( + secretProperty.getValue(), EncryptionToken.ofVaultKey())) + : original; return new SecretRetrievalStrategy.InPlace(val); }, p); @@ -86,7 +90,8 @@ public class SecretRetrievalStrategyHelper { p); } - public static OptionsBuilder comp(Property s, boolean allowNone, boolean allowUserSecretKey) { + public static OptionsBuilder comp( + Property s, boolean allowNone, boolean allowUserSecretKey) { SecretRetrievalStrategy strat = s.getValue(); var inPlace = new SimpleObjectProperty<>(strat instanceof SecretRetrievalStrategy.InPlace i ? i : null); var passwordManager = diff --git a/app/src/main/java/io/xpipe/app/util/ShellStoreFormat.java b/app/src/main/java/io/xpipe/app/util/ShellStoreFormat.java index ffe4940c6..7e8853312 100644 --- a/app/src/main/java/io/xpipe/app/util/ShellStoreFormat.java +++ b/app/src/main/java/io/xpipe/app/util/ShellStoreFormat.java @@ -28,7 +28,7 @@ public class ShellStoreFormat { var def = Boolean.TRUE.equals(s.getSetDefault()) ? AppI18n.get("default") : null; var name = DataStoreFormatter.join( (includeOsName ? formattedOsName(s.getOsName()) : null), s.getShellName()); - return new ShellStoreFormat(null, name, new String[] {def}).format(); + return new ShellStoreFormat(null, name, def).format(); }, AppPrefs.get().language(), section.getWrapper().getPersistentState()); @@ -46,28 +46,27 @@ public class ShellStoreFormat { return new ShellStoreFormat( LicenseProvider.get().checkOsName(s.getOsName()), formattedOsName(s.getOsName()), - new String[] {info}) + info) .format(); } if (s.getShellDialect().equals(ShellDialects.NO_INTERACTION)) { - return new ShellStoreFormat(null, null, new String[] {info}).format(); + return new ShellStoreFormat(null, null, info).format(); } return new ShellStoreFormat( LicenseProvider.get() .getFeature(s.getShellDialect().getLicenseFeatureId()), s.getShellDialect().getDisplayName(), - new String[] {info}) + info) .format(); } return new ShellStoreFormat( LicenseProvider.get().checkOsName(s.getOsName()), formattedOsName(s.getOsName()), - new String[] { - s.getTtyState() != null && s.getTtyState() != ShellTtyState.NONE ? "TTY" : null, info - }) + s.getTtyState() != null && s.getTtyState() != ShellTtyState.NONE ? "TTY" : null, + info) .format(); }); } diff --git a/app/src/main/java/io/xpipe/app/util/VaultKeySecretValue.java b/app/src/main/java/io/xpipe/app/util/VaultKeySecretValue.java index d0f7ee10c..4613d919a 100644 --- a/app/src/main/java/io/xpipe/app/util/VaultKeySecretValue.java +++ b/app/src/main/java/io/xpipe/app/util/VaultKeySecretValue.java @@ -9,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.experimental.SuperBuilder; import lombok.extern.jackson.Jacksonized; -import java.security.spec.InvalidKeySpecException; import javax.crypto.SecretKey; @JsonTypeName("vault") @@ -27,7 +26,7 @@ public class VaultKeySecretValue extends AesSecretValue { } @Override - protected SecretKey getSecretKey() throws InvalidKeySpecException { + protected SecretKey getSecretKey() { return DataStorage.getSecretKey(); } diff --git a/core/src/main/java/io/xpipe/core/process/StubShellControl.java b/core/src/main/java/io/xpipe/core/process/StubShellControl.java index c87743b96..27b29015a 100644 --- a/core/src/main/java/io/xpipe/core/process/StubShellControl.java +++ b/core/src/main/java/io/xpipe/core/process/StubShellControl.java @@ -12,5 +12,5 @@ public class StubShellControl extends WrapperShellControl { } @Override - public void close() throws Exception {} + public void close() {} } diff --git a/core/src/main/java/io/xpipe/core/util/CoreJacksonModule.java b/core/src/main/java/io/xpipe/core/util/CoreJacksonModule.java index 5791bd6cc..e081bb6d6 100644 --- a/core/src/main/java/io/xpipe/core/util/CoreJacksonModule.java +++ b/core/src/main/java/io/xpipe/core/util/CoreJacksonModule.java @@ -137,7 +137,7 @@ public class CoreJacksonModule extends SimpleModule { public ShellDialect deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { JsonNode tree = JacksonMapper.getDefault().readTree(p); if (tree.isObject()) { - var t = (JsonNode) tree.get("type"); + var t = tree.get("type"); if (t == null) { return null; } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseCompressAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseCompressAction.java index 8ac020467..bda2c7039 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseCompressAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseCompressAction.java @@ -204,8 +204,8 @@ public abstract class BaseCompressAction implements BrowserAction, BrowserBranch var base = new FilePath(model.getCurrentDirectory().getPath()); var target = base.join(fileName); var command = CommandBuilder.of().add("zip", "-r", "-"); - for (int i = 0; i < entries.size(); i++) { - var rel = new FilePath(entries.get(i).getRawFileEntry().getPath()) + for (BrowserEntry entry : entries) { + var rel = new FilePath(entry.getRawFileEntry().getPath()) .relativize(base) .toUnix(); if (directory) { @@ -261,8 +261,8 @@ public abstract class BaseCompressAction implements BrowserAction, BrowserBranch .add("a") .add("-r") .addFile(target); - for (int i = 0; i < entries.size(); i++) { - var rel = new FilePath(entries.get(i).getRawFileEntry().getPath()).relativize(base); + for (BrowserEntry entry : entries) { + var rel = new FilePath(entry.getRawFileEntry().getPath()).relativize(base); if (directory) { command.addQuoted(".\\" + rel.toDirectory().toWindows() + "*"); } else { diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseUntarAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseUntarAction.java index 4f5b5047b..a087c1838 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseUntarAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseUntarAction.java @@ -36,7 +36,7 @@ public class BaseUntarAction implements BrowserApplicationPathAction, BrowserLea } @Override - public void execute(BrowserFileSystemTabModel model, List entries) throws Exception { + public void execute(BrowserFileSystemTabModel model, List entries) { model.runAsync( () -> { ShellControl sc = model.getFileSystem().getShell().orElseThrow(); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseUnzipWindowsAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseUnzipWindowsAction.java index 13c877735..0dea4bee5 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseUnzipWindowsAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/compress/BaseUnzipWindowsAction.java @@ -30,7 +30,7 @@ public abstract class BaseUnzipWindowsAction implements BrowserLeafAction { } @Override - public void execute(BrowserFileSystemTabModel model, List entries) throws Exception { + public void execute(BrowserFileSystemTabModel model, List entries) { model.runAsync( () -> { var sc = model.getFileSystem().getShell().orElseThrow(); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopApplicationStore.java b/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopApplicationStore.java index 72aafebef..8f4b5acc4 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopApplicationStore.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopApplicationStore.java @@ -16,9 +16,9 @@ import lombok.extern.jackson.Jacksonized; @JsonTypeName("desktopApplication") public class DesktopApplicationStore implements DataStore { - private final DataStoreEntryRef desktop; - private final String path; - private final String arguments; + DataStoreEntryRef desktop; + String path; + String arguments; @Override public void checkComplete() throws Throwable { diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentityMigrationDeserializer.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentityMigrationDeserializer.java index 22fa612c3..348c84e85 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentityMigrationDeserializer.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentityMigrationDeserializer.java @@ -1,8 +1,6 @@ package io.xpipe.ext.base.identity; -import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.deser.std.DelegatingDeserializer; @@ -30,17 +28,16 @@ public class IdentityMigrationDeserializer extends DelegatingDeserializer { } @Override - public Object deserialize(JsonParser p, DeserializationContext ctxt, Object intoValue) - throws IOException, JsonProcessingException { + public Object deserialize(JsonParser p, DeserializationContext ctxt, Object intoValue) throws IOException { return super.deserialize(restructure(p), ctxt, intoValue); } public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) - throws IOException, JsonProcessingException { + throws IOException { return super.deserializeWithType(restructure(jp), ctxt, typeDeserializer); } - public JsonParser restructure(JsonParser p) throws IOException, JsonParseException { + public JsonParser restructure(JsonParser p) throws IOException { var node = p.readValueAsTree(); if (!node.isObject()) { return p; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/LocalIdentityStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/LocalIdentityStoreProvider.java index ce9bee3ff..da66b01a4 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/LocalIdentityStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/LocalIdentityStoreProvider.java @@ -43,7 +43,9 @@ public class LocalIdentityStoreProvider extends IdentityStoreProvider { .name("keyAuthentication") .description("keyAuthenticationDescription") .longDescription("base:sshKey") - .sub(SshIdentityStrategyHelper.identity(new SimpleObjectProperty<>(), identity, null,false, true), identity) + .sub( + SshIdentityStrategyHelper.identity(new SimpleObjectProperty<>(), identity, null, false, true), + identity) .bind( () -> { return LocalIdentityStore.builder() diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/SshIdentityStrategyHelper.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/SshIdentityStrategyHelper.java index fd0444dad..76e5701e7 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/SshIdentityStrategyHelper.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/SshIdentityStrategyHelper.java @@ -56,7 +56,10 @@ public class SshIdentityStrategyHelper { ? fileProperty.getValue().getFile().toAbsoluteFilePath(null) : null); fileProperty.addListener((observable, oldValue, newValue) -> { - keyPath.setValue(newValue != null && newValue.getFile() != null ? newValue.getFile().toAbsoluteFilePath(null) : null); + keyPath.setValue( + newValue != null && newValue.getFile() != null + ? newValue.getFile().toAbsoluteFilePath(null) + : null); }); var keyPasswordProperty = new SimpleObjectProperty<>( fileProperty.getValue() != null ? fileProperty.getValue().getPassword() : null); @@ -73,7 +76,9 @@ public class SshIdentityStrategyHelper { .nonNull() .name("keyPassword") .description("sshConfigHost.identityPassphraseDescription") - .sub(SecretRetrievalStrategyHelper.comp(keyPasswordProperty, true, allowUserSecretKey), keyPasswordProperty) + .sub( + SecretRetrievalStrategyHelper.comp(keyPasswordProperty, true, allowUserSecretKey), + keyPasswordProperty) .nonNull() .bind( () -> { @@ -103,7 +108,9 @@ public class SshIdentityStrategyHelper { var map = new LinkedHashMap, OptionsBuilder>(); map.put(AppI18n.observable("base.none"), new OptionsBuilder()); - map.put(AppI18n.observable("base.keyFile"), fileIdentity(proxy, file, perUserFile, allowSync, allowUserSecretKey)); + map.put( + AppI18n.observable("base.keyFile"), + fileIdentity(proxy, file, perUserFile, allowSync, allowUserSecretKey)); map.put(AppI18n.observable("base.sshAgent"), agent(agent)); map.put(AppI18n.observable("base.pageant"), new OptionsBuilder()); map.put(gpgFeature.suffixObservable("base.gpgAgent"), new OptionsBuilder()); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/SyncedIdentityStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/SyncedIdentityStoreProvider.java index d184978d4..46ddde6b2 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/SyncedIdentityStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/SyncedIdentityStoreProvider.java @@ -65,7 +65,7 @@ public class SyncedIdentityStoreProvider extends IdentityStoreProvider { .longDescription("base:sshKey") .sub( SshIdentityStrategyHelper.identity( - new SimpleObjectProperty<>(), identity, path -> perUser.get(),true, true), + new SimpleObjectProperty<>(), identity, path -> perUser.get(), true, true), identity) .check(val -> Validator.create(val, AppI18n.observable("keyNotSynced"), identity, i -> { var wrong = i instanceof SshIdentityStrategy.File f diff --git a/ext/base/src/main/java/io/xpipe/ext/base/script/RunScriptAction.java b/ext/base/src/main/java/io/xpipe/ext/base/script/RunScriptAction.java index 1c85197f7..992c0b98e 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/script/RunScriptAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/script/RunScriptAction.java @@ -52,7 +52,7 @@ public class RunScriptAction implements BrowserAction, BrowserBranchAction { if (actions.isEmpty()) { actions = List.of(new BrowserLeafAction() { @Override - public void execute(BrowserFileSystemTabModel model, List entries) throws Exception { + public void execute(BrowserFileSystemTabModel model, List entries) { StoreViewState.get().getAllScriptsCategory().select(); AppLayoutModel.get().selectConnections(); } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStore.java b/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStore.java index 5c03b94cd..cf97c9f8b 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStore.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStore.java @@ -31,12 +31,12 @@ import java.util.stream.Collectors; @ToString(callSuper = true) public class SimpleScriptStore extends ScriptStore implements ShellInitCommand.Terminal, SelfReferentialStore { - private final ShellDialect minimumDialect; - private final String commands; - private final boolean initScript; - private final boolean shellScript; - private final boolean fileScript; - private final boolean runnableScript; + ShellDialect minimumDialect; + String commands; + boolean initScript; + boolean shellScript; + boolean fileScript; + boolean runnableScript; public String getCommands() { return commands != null ? commands : ""; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/service/AbstractServiceStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/service/AbstractServiceStoreProvider.java index 03237a526..a4dcd895a 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/service/AbstractServiceStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/service/AbstractServiceStoreProvider.java @@ -3,7 +3,6 @@ package io.xpipe.ext.base.service; import io.xpipe.app.comp.Comp; import io.xpipe.app.comp.store.*; import io.xpipe.app.core.AppI18n; -import io.xpipe.app.ext.ActionProvider; import io.xpipe.app.ext.DataStoreProvider; import io.xpipe.app.ext.DataStoreUsageCategory; import io.xpipe.app.ext.SingletonSessionStoreProvider; @@ -115,8 +114,8 @@ public abstract class AbstractServiceStoreProvider implements SingletonSessionSt var desc = s.getLocalPort() != null ? "localhost:" + s.getLocalPort() + " <- :" + s.getRemotePort() : s.isSessionRunning() - ? "localhost:" + s.getSession().getLocalPort() + " <- :" + s.getRemotePort() - : AppI18n.get("servicePort", s.getRemotePort()); + ? "localhost:" + s.getSession().getLocalPort() + " <- :" + s.getRemotePort() + : AppI18n.get("servicePort", s.getRemotePort()); return desc; } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/service/FixedServiceStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/service/FixedServiceStoreProvider.java index c19814983..da9b13e35 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/service/FixedServiceStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/service/FixedServiceStoreProvider.java @@ -1,9 +1,7 @@ package io.xpipe.ext.base.service; import io.xpipe.app.comp.store.StoreChoiceComp; -import io.xpipe.app.comp.store.StoreSection; import io.xpipe.app.comp.store.StoreViewState; -import io.xpipe.app.core.AppI18n; import io.xpipe.app.ext.GuiDialog; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.storage.DataStoreEntry; @@ -13,8 +11,6 @@ import io.xpipe.core.store.NetworkTunnelStore; import javafx.beans.property.Property; import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.value.ObservableValue; import java.util.List; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/service/MappedServiceStore.java b/ext/base/src/main/java/io/xpipe/ext/base/service/MappedServiceStore.java index 7de6d80a7..a1edeb747 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/service/MappedServiceStore.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/service/MappedServiceStore.java @@ -15,7 +15,7 @@ import lombok.extern.jackson.Jacksonized; @JsonTypeName("mappedService") public class MappedServiceStore extends FixedServiceStore { - private final int containerPort; + int containerPort; @Override public boolean licenseRequired() { diff --git a/ext/base/src/main/java/io/xpipe/ext/base/service/MappedServiceStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/service/MappedServiceStoreProvider.java index 69c1d7cc0..2a7d3c48a 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/service/MappedServiceStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/service/MappedServiceStoreProvider.java @@ -1,20 +1,16 @@ package io.xpipe.ext.base.service; import io.xpipe.app.comp.store.StoreChoiceComp; -import io.xpipe.app.comp.store.StoreSection; import io.xpipe.app.comp.store.StoreViewState; -import io.xpipe.app.core.AppI18n; import io.xpipe.app.ext.GuiDialog; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.storage.DataStoreEntry; - import io.xpipe.app.util.OptionsBuilder; import io.xpipe.core.store.DataStore; import io.xpipe.core.store.NetworkTunnelStore; + import javafx.beans.property.Property; import javafx.beans.property.SimpleObjectProperty; -import javafx.beans.property.SimpleStringProperty; -import javafx.beans.value.ObservableValue; import java.util.List; @@ -35,8 +31,9 @@ public class MappedServiceStoreProvider extends FixedServiceStoreProvider { var desc = s.getLocalPort() != null ? "localhost:" + s.getLocalPort() + " <- :" + m.getRemotePort() + " <- :" + m.getContainerPort() : s.isSessionRunning() - ? "localhost:" + s.getSession().getLocalPort() + " <- :" + m.getRemotePort() + " <- :" + m.getContainerPort() - : ":" + m.getRemotePort() + " <- :" + m.getContainerPort(); + ? "localhost:" + s.getSession().getLocalPort() + " <- :" + m.getRemotePort() + " <- :" + + m.getContainerPort() + : ":" + m.getRemotePort() + " <- :" + m.getContainerPort(); return desc; } @@ -45,7 +42,6 @@ public class MappedServiceStoreProvider extends FixedServiceStoreProvider { return List.of(MappedServiceStore.class); } - @Override public GuiDialog guiDialog(DataStoreEntry entry, Property store) { MappedServiceStore st = store.getValue().asNeeded(); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/service/ServiceProtocolType.java b/ext/base/src/main/java/io/xpipe/ext/base/service/ServiceProtocolType.java index 12371350a..3f6032cc2 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/service/ServiceProtocolType.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/service/ServiceProtocolType.java @@ -17,17 +17,17 @@ import lombok.extern.jackson.Jacksonized; }) public interface ServiceProtocolType { - public abstract String formatUrl(String base); + String formatUrl(String base); - public abstract void open(String url); + void open(String url); - public abstract String getTranslationKey(); + String getTranslationKey(); @JsonTypeName("none") @Value @Jacksonized @Builder - public static class None implements ServiceProtocolType { + class None implements ServiceProtocolType { @Override public String formatUrl(String base) { @@ -47,7 +47,7 @@ public interface ServiceProtocolType { @Value @Jacksonized @Builder - public static class Http implements ServiceProtocolType { + class Http implements ServiceProtocolType { String path; @@ -75,7 +75,7 @@ public interface ServiceProtocolType { @Value @Jacksonized @Builder - public static class Https implements ServiceProtocolType { + class Https implements ServiceProtocolType { String path; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/service/ServiceRefreshAction.java b/ext/base/src/main/java/io/xpipe/ext/base/service/ServiceRefreshAction.java index d20379f79..b3abd527c 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/service/ServiceRefreshAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/service/ServiceRefreshAction.java @@ -53,7 +53,7 @@ public class ServiceRefreshAction implements ActionProvider { DataStoreEntryRef ref; @Override - public void execute() throws Exception { + public void execute() { ref.get().setExpanded(true); var e = DataStorage.get() .addStoreIfNotPresent( diff --git a/ext/base/src/main/java/io/xpipe/ext/base/store/StoreRestartAction.java b/ext/base/src/main/java/io/xpipe/ext/base/store/StoreRestartAction.java index c65a7b792..4384bc1a9 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/store/StoreRestartAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/store/StoreRestartAction.java @@ -13,7 +13,7 @@ public class StoreRestartAction implements ActionProvider { @Override public LeafDataStoreCallSite getLeafDataStoreCallSite() { - return new LeafDataStoreCallSite() { + return new LeafDataStoreCallSite<>() { @Override public ActionProvider.Action createAction(DataStoreEntryRef store) { diff --git a/ext/base/src/main/java/module-info.java b/ext/base/src/main/java/module-info.java index debb3baa7..9d86dc347 100644 --- a/ext/base/src/main/java/module-info.java +++ b/ext/base/src/main/java/module-info.java @@ -5,6 +5,7 @@ import io.xpipe.app.ext.DataStoreProvider; import io.xpipe.ext.base.action.*; import io.xpipe.ext.base.browser.*; import io.xpipe.ext.base.browser.compress.*; +import io.xpipe.ext.base.desktop.DesktopApplicationStoreProvider; import io.xpipe.ext.base.identity.*; import io.xpipe.ext.base.script.*; import io.xpipe.ext.base.service.*; @@ -12,7 +13,6 @@ import io.xpipe.ext.base.store.StorePauseAction; import io.xpipe.ext.base.store.StoreRestartAction; import io.xpipe.ext.base.store.StoreStartAction; import io.xpipe.ext.base.store.StoreStopAction; -import io.xpipe.ext.base.desktop.DesktopApplicationStoreProvider; open module io.xpipe.ext.base { exports io.xpipe.ext.base; diff --git a/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusCommandView.java b/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusCommandView.java index 0e927dcac..563bd2dbd 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusCommandView.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusCommandView.java @@ -98,11 +98,11 @@ public class IncusCommandView extends CommandViewBase { .execute(); } - public CommandControl console(String containerName) throws Exception { + public CommandControl console(String containerName) { return build(commandBuilder -> commandBuilder.add("console").addQuoted(containerName)); } - public CommandControl configEdit(String containerName) throws Exception { + public CommandControl configEdit(String containerName) { return build(commandBuilder -> commandBuilder.add("config", "edit").addQuoted(containerName)); } diff --git a/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusContainerStore.java b/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusContainerStore.java index 03329f05a..079f7dc22 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusContainerStore.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusContainerStore.java @@ -73,7 +73,7 @@ public class IncusContainerStore } @Override - public ShellControl control(ShellControl parent) throws Exception { + public ShellControl control(ShellControl parent) { var user = identity != null ? identity.unwrap().getUsername() : null; var sc = new IncusCommandView(parent).exec(containerName, user); sc.withSourceStore(IncusContainerStore.this); diff --git a/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusScanProvider.java b/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusScanProvider.java index 3e2ab02ab..a16910c7c 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusScanProvider.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/incus/IncusScanProvider.java @@ -18,7 +18,7 @@ public class IncusScanProvider extends ScanProvider { } @Override - public void scan(DataStoreEntry entry, ShellControl sc) throws Throwable { + public void scan(DataStoreEntry entry, ShellControl sc) { var e = DataStorage.get() .addStoreIfNotPresent( entry, diff --git a/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdCmdStore.java b/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdCmdStore.java index 1c1d19ae5..f43556182 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdCmdStore.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdCmdStore.java @@ -25,7 +25,7 @@ import java.util.regex.Pattern; @Value public class LxdCmdStore implements FixedHierarchyStore, StatefulDataStore, SelfReferentialStore { - private final DataStoreEntryRef host; + DataStoreEntryRef host; public LxdCmdStore(DataStoreEntryRef host) { this.host = host; diff --git a/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdCommandView.java b/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdCommandView.java index 8378baf87..ba6eb02e6 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdCommandView.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdCommandView.java @@ -106,11 +106,11 @@ public class LxdCommandView extends CommandViewBase { .execute(); } - public CommandControl console(String containerName) throws Exception { + public CommandControl console(String containerName) { return build(commandBuilder -> commandBuilder.add("console").addQuoted(containerName)); } - public CommandControl configEdit(String containerName) throws Exception { + public CommandControl configEdit(String containerName) { return build(commandBuilder -> commandBuilder.add("config", "edit").addQuoted(containerName)); } diff --git a/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdContainerStore.java b/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdContainerStore.java index 5baf53c60..6e1217e75 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdContainerStore.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdContainerStore.java @@ -36,8 +36,8 @@ public class LxdContainerStore StoppableStore, PauseableStore { - private final DataStoreEntryRef cmd; - private final String containerName; + DataStoreEntryRef cmd; + String containerName; IdentityValue identity; @Override @@ -71,7 +71,7 @@ public class LxdContainerStore } @Override - public ShellControl control(ShellControl parent) throws Exception { + public ShellControl control(ShellControl parent) { var user = identity != null ? identity.unwrap().getUsername() : null; var base = new LxdCommandView(parent).exec(containerName, user); if (identity != null && identity.unwrap().getPassword() != null) { diff --git a/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdScanProvider.java b/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdScanProvider.java index a83590a8d..4c25c114f 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdScanProvider.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/lxd/LxdScanProvider.java @@ -18,7 +18,7 @@ public class LxdScanProvider extends ScanProvider { } @Override - public void scan(DataStoreEntry entry, ShellControl sc) throws Throwable { + public void scan(DataStoreEntry entry, ShellControl sc) { var e = DataStorage.get() .addStoreIfNotPresent( entry, diff --git a/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanCmdStore.java b/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanCmdStore.java index af22d2be1..4c0a5fbe4 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanCmdStore.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanCmdStore.java @@ -28,7 +28,7 @@ import java.util.regex.Pattern; public class PodmanCmdStore implements FixedHierarchyStore, StatefulDataStore, SelfReferentialStore { - private final DataStoreEntryRef host; + DataStoreEntryRef host; public PodmanCmdStore(DataStoreEntryRef host) { this.host = host; diff --git a/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanContainerAttachAction.java b/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanContainerAttachAction.java index 93d91f2ce..e438168f7 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanContainerAttachAction.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanContainerAttachAction.java @@ -16,7 +16,7 @@ public class PodmanContainerAttachAction implements ActionProvider { @Override public Action createAction(DataStoreEntryRef store) { return () -> { - var d = (PodmanContainerStore) store.getStore(); + var d = store.getStore(); var view = d.commandView( d.getCmd().getStore().getHost().getStore().getOrStartSession()); TerminalLauncher.open(store.get().getName(), view.attach(d.getContainerName())); diff --git a/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanContainerStore.java b/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanContainerStore.java index f2cddc345..7411f5ec7 100644 --- a/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanContainerStore.java +++ b/ext/system/src/main/java/io/xpipe/ext/system/podman/PodmanContainerStore.java @@ -45,8 +45,8 @@ public class PodmanContainerStore SelfReferentialStore, ContainerImageStore { - private final DataStoreEntryRef cmd; - private final String containerName; + DataStoreEntryRef cmd; + String containerName; @Override public String getImageName() {