From ecd3bf4c840215f95b656c0e34a54bcac9832fc0 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Mon, 6 Jun 2022 22:37:57 +0200 Subject: [PATCH] Fix formatting issues reported by Spotless --- .../android/common/view/SlidingTabLayout.java | 8 ++- .../actions/AbstractRouterAction.java | 4 +- .../router_companion/resources/Device.java | 16 +++-- .../resources/conn/Router.java | 72 ++++++++++++++----- .../rm3l/router_companion/utils/SSHUtils.java | 4 +- .../utils/customtabs/CustomTabsHelper.java | 4 +- 6 files changed, 81 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/com/android/common/view/SlidingTabLayout.java b/app/src/main/java/com/android/common/view/SlidingTabLayout.java index f55447065..f7e2df127 100644 --- a/app/src/main/java/com/android/common/view/SlidingTabLayout.java +++ b/app/src/main/java/com/android/common/view/SlidingTabLayout.java @@ -111,10 +111,14 @@ public void onClick(View v) { */ public interface TabColorizer { - /** @return return the color of the divider drawn to the right of {@code position}. */ + /** + * @return return the color of the divider drawn to the right of {@code position}. + */ int getDividerColor(int position); - /** @return return the color of the indicator used when {@code position} is selected. */ + /** + * @return return the color of the indicator used when {@code position} is selected. + */ int getIndicatorColor(int position); } diff --git a/app/src/main/java/org/rm3l/router_companion/actions/AbstractRouterAction.java b/app/src/main/java/org/rm3l/router_companion/actions/AbstractRouterAction.java index ae34ab53d..173304af8 100644 --- a/app/src/main/java/org/rm3l/router_companion/actions/AbstractRouterAction.java +++ b/app/src/main/java/org/rm3l/router_companion/actions/AbstractRouterAction.java @@ -48,7 +48,9 @@ public abstract class AbstractRouterAction extends UiRelatedTask> { - /** @param the result type */ + /** + * @param the result type + */ public static class RouterActionResult { @Nullable private final Exception exception; diff --git a/app/src/main/java/org/rm3l/router_companion/resources/Device.java b/app/src/main/java/org/rm3l/router_companion/resources/Device.java index 283b23670..4166921ad 100644 --- a/app/src/main/java/org/rm3l/router_companion/resources/Device.java +++ b/app/src/main/java/org/rm3l/router_companion/resources/Device.java @@ -228,7 +228,9 @@ public int getActiveIpConnectionsCount() { return (activeIpConnections != null ? activeIpConnections.size() : -1); } - /** @return the alias */ + /** + * @return the alias + */ @Nullable public String getAlias() { return alias; @@ -270,7 +272,9 @@ public void setDeviceUuidForWol(String deviceUuidForWol) { this.deviceUuidForWol = deviceUuidForWol; } - /** @return the IP */ + /** + * @return the IP + */ @Nullable public String getIpAddress() { return ipAddress; @@ -296,7 +300,9 @@ public void setLastSeen(long lastSeen) { this.lastSeen = lastSeen; } - /** @return the MAC */ + /** + * @return the MAC + */ @NonNull public String getMacAddress() { return macAddress; @@ -339,7 +345,9 @@ public void setRxTotal(double rxTotal) { this.rxTotal = rxTotal; } - /** @return the system name */ + /** + * @return the system name + */ @Nullable public String getSystemName() { return systemName; diff --git a/app/src/main/java/org/rm3l/router_companion/resources/conn/Router.java b/app/src/main/java/org/rm3l/router_companion/resources/conn/Router.java index 0652cfdec..2c0cc8b80 100644 --- a/app/src/main/java/org/rm3l/router_companion/resources/conn/Router.java +++ b/app/src/main/java/org/rm3l/router_companion/resources/conn/Router.java @@ -326,24 +326,32 @@ public enum RouterConnectionProtocol { this.defaultPassword = defaultPassword; } - /** @return the channel */ + /** + * @return the channel + */ @NonNull public String getChannel() { return channel; } - /** @return the defaultPassword */ + /** + * @return the defaultPassword + */ @Nullable public String getDefaultPassword() { return defaultPassword; } - /** @return the defaultPort */ + /** + * @return the defaultPort + */ public int getDefaultPort() { return defaultPort; } - /** @return the defaultUsername */ + /** + * @return the defaultUsername + */ @Nullable public String getDefaultUsername() { return defaultUsername; @@ -1218,7 +1226,9 @@ public void setIconPath(String iconPath) { this.iconPath = iconPath; } - /** @return the internal DB id */ + /** + * @return the internal DB id + */ public int getId() { return id; } @@ -1257,7 +1267,9 @@ public Collection getLocalSSIDLookupData(@NonNull final Context return localSSIDLookups; } - /** @return the name */ + /** + * @return the name + */ @Nullable public String getName() { return name; @@ -1289,13 +1301,17 @@ public Router setOrderIndex(int orderIndex) { return this; } - /** @return the password */ + /** + * @return the password + */ @Nullable public String getPassword() { return password; } - /** @return the password */ + /** + * @return the password + */ @Nullable public String getPasswordPlain() { return password != null ? d(password) : null; @@ -1306,19 +1322,25 @@ public SharedPreferences getPreferences(@Nullable final Context ctx) { return getPreferences(this, ctx); } - /** @return the privKey */ + /** + * @return the privKey + */ @Nullable public String getPrivKey() { return privKey; } - /** @return the decrypted privKey */ + /** + * @return the decrypted privKey + */ @Nullable public String getPrivKeyPlain() { return privKey != null ? d(privKey) : null; } - /** @return the remoteIpAddress */ + /** + * @return the remoteIpAddress + */ @NonNull public String getRemoteIpAddress() { return remoteIpAddress; @@ -1336,7 +1358,9 @@ public Router setRemoteIpAddress(@NonNull final String remoteIpAddress) { return this; } - /** @return the remotePort, if any, or the default port for the routerConnectionProtocol */ + /** + * @return the remotePort, if any, or the default port for the routerConnectionProtocol + */ public int getRemotePort() { return remotePort <= 0 ? this.routerConnectionProtocol.getDefaultPort() : remotePort; } @@ -1353,7 +1377,9 @@ public Router setRemotePort(final int remotePort) { return this; } - /** @return the RouterConnectionProtocol */ + /** + * @return the RouterConnectionProtocol + */ @NonNull public RouterConnectionProtocol getRouterConnectionProtocol() { return routerConnectionProtocol; @@ -1442,19 +1468,25 @@ public String getTemplateUuidOrUuid() { return templateUuid != null ? templateUuid : uuid; } - /** @return the username */ + /** + * @return the username + */ @NonNull public String getUsername() { return username; } - /** @return the unencrypted username */ + /** + * @return the unencrypted username + */ @Nullable public String getUsernamePlain() { return d(username); } - /** @return the uuid */ + /** + * @return the uuid + */ @NonNull public String getUuid() { return uuid; @@ -1505,7 +1537,9 @@ public boolean isFallbackToPrimaryAddr(@Nullable final Context ctx) { return sharedPreferences.getBoolean(FALLBACK_TO_PRIMARY_ADDR, false); } - /** @return whether the strictHostKeyChecking flag is on or off */ + /** + * @return whether the strictHostKeyChecking flag is on or off + */ public boolean isStrictHostKeyChecking() { return strictHostKeyChecking; } @@ -1630,7 +1664,9 @@ public RouterInfo toRouterInfo() { .setDemoRouter(Utils.isDemoRouter(this)); } - /** @return the Router string representation */ + /** + * @return the Router string representation + */ @Override @NonNull public String toString() { diff --git a/app/src/main/java/org/rm3l/router_companion/utils/SSHUtils.java b/app/src/main/java/org/rm3l/router_companion/utils/SSHUtils.java index aa5ec6dc2..c70f68ded 100644 --- a/app/src/main/java/org/rm3l/router_companion/utils/SSHUtils.java +++ b/app/src/main/java/org/rm3l/router_companion/utils/SSHUtils.java @@ -999,7 +999,9 @@ private static int checkAck(@NonNull final InputStream in) throws IOException { return b; } - /** @throws java.io.IOException */ + /** + * @throws java.io.IOException + */ private static boolean closeChannel( @NonNull final Channel channel, @Nullable final OutputStream out) throws IOException { diff --git a/app/src/main/java/org/rm3l/router_companion/utils/customtabs/CustomTabsHelper.java b/app/src/main/java/org/rm3l/router_companion/utils/customtabs/CustomTabsHelper.java index d3005d3fb..ccc8f8ef5 100644 --- a/app/src/main/java/org/rm3l/router_companion/utils/customtabs/CustomTabsHelper.java +++ b/app/src/main/java/org/rm3l/router_companion/utils/customtabs/CustomTabsHelper.java @@ -93,7 +93,9 @@ public static String getPackageNameToUse(Context context) { return sPackageNameToUse; } - /** @return All possible chrome package names that provide custom tabs feature. */ + /** + * @return All possible chrome package names that provide custom tabs feature. + */ public static String[] getPackages() { return new String[] {"", STABLE_PACKAGE, BETA_PACKAGE, DEV_PACKAGE, LOCAL_PACKAGE}; }