소스 검색

fragment:util: Added private constructor to hide the inherit public one

Utility classes, which are collections of static members, are not meant to be instantiated.

Java adds an implicit public constructor to every class which does not define at least one explicitly. Hence, at least one non-public constructor should be defined.
eho 6 년 전
부모
커밋
d5b500559e
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/main/java/com/owncloud/android/ui/fragment/util/FileDetailSharingFragmentHelper.java

+ 4 - 0
src/main/java/com/owncloud/android/ui/fragment/util/FileDetailSharingFragmentHelper.java

@@ -39,6 +39,10 @@ import java.util.Date;
  */
 public class FileDetailSharingFragmentHelper {
 
+    private FileDetailSharingFragmentHelper() {
+        // Private empty constructor
+    }
+
     /**
      * Sets checked/visiblity state on the given {@link MenuItem} based on the given criteria.
      *