Browse Source

codacy: make utilities classes final with private constructor

AndyScherzinger 6 years ago
parent
commit
0f7fe6fd1c

+ 4 - 1
src/main/java/com/owncloud/android/authentication/AuthenticatorUrlUtils.java

@@ -32,7 +32,7 @@ import java.util.Locale;
 /**
  * Helper class for authenticator-URL related logic.
  */
-public abstract class AuthenticatorUrlUtils {
+public final class AuthenticatorUrlUtils {
     public static final String WEBDAV_PATH_4_0_AND_LATER = "/remote.php/webdav";
 
     private static final String HTTPS_PROTOCOL = "https://";
@@ -41,6 +41,9 @@ public abstract class AuthenticatorUrlUtils {
     private static final String ODAV_PATH = "/remote.php/odav";
     private static final String SAML_SSO_PATH = "/remote.php/webdav";
 
+    private AuthenticatorUrlUtils() {
+    }
+
     /**
      * Returns the proper URL path to access the WebDAV interface of an ownCloud server,
      * according to its version and the authorization method used.

+ 4 - 1
src/main/java/com/owncloud/android/db/PreferenceManager.java

@@ -36,7 +36,7 @@ import static com.owncloud.android.ui.fragment.OCFileListFragment.FOLDER_LAYOUT_
 /**
  * Helper to simplify reading of Preferences all around the app
  */
-public abstract class PreferenceManager {
+public final class PreferenceManager {
     /**
      * Constant to access value of last path selected by the user to upload a file shared from other app.
      * Value handled by the app without direct access in the UI.
@@ -65,6 +65,9 @@ public abstract class PreferenceManager {
     private static final String PREF__FOLDER_SORT_ORDER = "folder_sort_order";
     private static final String PREF__FOLDER_LAYOUT = "folder_layout";
 
+    private PreferenceManager() {
+    }
+
     public static void setKeysReInit(Context context) {
         saveBooleanPreference(context, PREF__KEYS_REINIT, true);
     }