From 65df2e82b3a0eaccf5899bea5403a9a011b65094 Mon Sep 17 00:00:00 2001 From: AndyScherzinger Date: Mon, 10 Sep 2018 21:57:03 +0200 Subject: [PATCH] codacy: utils classes are to be final with private constructor --- src/generic/java/com/owncloud/android/utils/PushUtils.java | 5 ++++- src/gplay/java/com/owncloud/android/utils/PushUtils.java | 5 ++++- .../owncloud/android/datamodel/ThumbnailsCacheManager.java | 5 ++++- .../java/com/owncloud/android/utils/PushUtils.java | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/generic/java/com/owncloud/android/utils/PushUtils.java b/src/generic/java/com/owncloud/android/utils/PushUtils.java index ad7d21756e..19cc9af6f0 100644 --- a/src/generic/java/com/owncloud/android/utils/PushUtils.java +++ b/src/generic/java/com/owncloud/android/utils/PushUtils.java @@ -28,9 +28,12 @@ import com.owncloud.android.db.PreferenceManager; import java.security.Key; -public class PushUtils { +public final class PushUtils { public static final String KEY_PUSH = "push"; + private PushUtils() { + } + public static void pushRegistrationToServer() { // do nothing } diff --git a/src/gplay/java/com/owncloud/android/utils/PushUtils.java b/src/gplay/java/com/owncloud/android/utils/PushUtils.java index c3d148f4e6..e5c823bd86 100644 --- a/src/gplay/java/com/owncloud/android/utils/PushUtils.java +++ b/src/gplay/java/com/owncloud/android/utils/PushUtils.java @@ -71,7 +71,7 @@ import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; import java.util.Locale; -public class PushUtils { +public final class PushUtils { public static final String KEY_PUSH = "push"; private static final String TAG = "PushUtils"; @@ -81,6 +81,9 @@ public class PushUtils { private static final String KEYPAIR_PUB_EXTENSION = ".pub"; private static ArbitraryDataProvider arbitraryDataProvider; + private PushUtils() { + } + public static String generateSHA512Hash(String pushToken) { MessageDigest messageDigest = null; try { diff --git a/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java b/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java index bc6d982d88..b689274732 100644 --- a/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java +++ b/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java @@ -78,7 +78,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * Manager for concurrent access to thumbnails cache. */ -public class ThumbnailsCacheManager { +public final class ThumbnailsCacheManager { public static final String PREFIX_RESIZED_IMAGE = "r"; public static final String PREFIX_THUMBNAIL = "t"; @@ -103,6 +103,9 @@ public class ThumbnailsCacheManager { public static final Bitmap mDefaultVideo = BitmapFactory.decodeResource(MainApp.getAppContext().getResources(), R.drawable.file_movie); + + private ThumbnailsCacheManager() { + } public static class InitDiskCacheTask extends AsyncTask { @Override diff --git a/src/versionDev/java/com/owncloud/android/utils/PushUtils.java b/src/versionDev/java/com/owncloud/android/utils/PushUtils.java index 68f2face04..58db3d2477 100644 --- a/src/versionDev/java/com/owncloud/android/utils/PushUtils.java +++ b/src/versionDev/java/com/owncloud/android/utils/PushUtils.java @@ -28,9 +28,12 @@ import com.owncloud.android.db.PreferenceManager; import java.security.Key; -public class PushUtils { +public final class PushUtils { public static final String KEY_PUSH = "push"; + private PushUtils() { + } + public static void pushRegistrationToServer() { // do nothing }