From 46f916b1a271b1cf72753d53d6fd1f857994c48e Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 18 Oct 2018 15:59:00 +0200 Subject: [PATCH] satisfy codacy Signed-off-by: tobiasKaminsky --- .../owncloud/android/ui/preview/PreviewTextFragment.java | 2 +- src/main/java/com/owncloud/android/utils/StringUtils.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/preview/PreviewTextFragment.java b/src/main/java/com/owncloud/android/ui/preview/PreviewTextFragment.java index dd533e7da7..82d64e62dc 100644 --- a/src/main/java/com/owncloud/android/ui/preview/PreviewTextFragment.java +++ b/src/main/java/com/owncloud/android/ui/preview/PreviewTextFragment.java @@ -227,7 +227,7 @@ public class PreviewTextFragment extends FileFragment implements SearchView.OnQu mHandler.removeCallbacksAndMessages(null); if (mOriginalText != null) { - if (getActivity() != null && getActivity() instanceof FileDisplayActivity) { + if (getActivity() instanceof FileDisplayActivity) { FileDisplayActivity fileDisplayActivity = (FileDisplayActivity) getActivity(); fileDisplayActivity.setSearchQuery(query); } diff --git a/src/main/java/com/owncloud/android/utils/StringUtils.java b/src/main/java/com/owncloud/android/utils/StringUtils.java index 99791b1c40..50888df0ef 100644 --- a/src/main/java/com/owncloud/android/utils/StringUtils.java +++ b/src/main/java/com/owncloud/android/utils/StringUtils.java @@ -29,7 +29,11 @@ import java.util.regex.Pattern; /** * Helper class for handling and manipulating strings. */ -public class StringUtils { +public final class StringUtils { + + private StringUtils() { + // prevent class from being constructed + } public static String searchAndColor(String text, String searchText, @ColorInt int color) {