소스 검색

codacy: Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 6 년 전
부모
커밋
e1ec691d4a

+ 28 - 6
src/main/java/com/nextcloud/android/sso/Constants.java

@@ -1,11 +1,30 @@
+/*
+ * Nextcloud Android client application
+ *
+ * @author David Luhmer
+ * @author Tobias Kaminsky
+ * @author Edvard Holst
+ * Copyright (C) 2019 David Luhmer
+ * Copyright (C) 2019 Tobias Kaminsky
+ * Copyright (C) 2019 Edvard Holst
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 package com.nextcloud.android.sso;
 
 public class Constants {
-
-    private Constants() {
-        // No instance
-    }
-
     // Authenticator related constants
     public static final String SSO_USERNAME = "username";
     public static final String SSO_TOKEN = "token";
@@ -16,7 +35,6 @@ public class Constants {
     public static final String NEXTCLOUD_FILES_ACCOUNT = "NextcloudFilesAccount";
     public static final String DELIMITER = "_";
 
-
     // Custom Exceptions
     public static final String EXCEPTION_INVALID_TOKEN = "CE_1";
     public static final String EXCEPTION_ACCOUNT_NOT_FOUND = "CE_2";
@@ -24,4 +42,8 @@ public class Constants {
     public static final String EXCEPTION_INVALID_REQUEST_URL = "CE_4";
     public static final String EXCEPTION_HTTP_REQUEST_FAILED = "CE_5";
     public static final String EXCEPTION_ACCOUNT_ACCESS_DECLINED = "CE_6";
+
+    private Constants() {
+        // No instance
+    }
 }

+ 1 - 0
src/main/java/com/nextcloud/android/sso/InputStreamBinder.java

@@ -2,6 +2,7 @@
  * Nextcloud SingleSignOn
  *
  * @author David Luhmer
+ * Copyright (C) 2019 David Luhmer
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by

+ 5 - 7
src/main/java/com/owncloud/android/authentication/OAuth2Constants.java

@@ -1,4 +1,4 @@
-/**
+/*
  *   ownCloud Android client application
  *
  *   @author David A. Velasco
@@ -27,11 +27,6 @@ package com.owncloud.android.authentication;
  */
 
 public class OAuth2Constants {
-
-    private OAuth2Constants() {
-        // No instance
-    }
-    
     /// Parameters to send to the Authorization Endpoint
     public static final String KEY_RESPONSE_TYPE = "response_type";
     public static final String KEY_REDIRECT_URI = "redirect_uri";
@@ -54,5 +49,8 @@ public class OAuth2Constants {
     public static final String KEY_ERROR_DESCRIPTION = "error_description";
     public static final String KEY_ERROR_URI = "error_uri";
     public static final String VALUE_ERROR_ACCESS_DENIED = "access_denied";
-    
+
+    private OAuth2Constants() {
+        // No instance
+    }
 }

+ 7 - 9
src/main/java/com/owncloud/android/db/ProviderMeta.java

@@ -30,20 +30,14 @@ import com.owncloud.android.MainApp;
  * Meta-Class that holds various static field information
  */
 public class ProviderMeta {
-
-    public static final String DB_NAME = "filelist";
-    public static final int DB_VERSION = 44;
-
     private ProviderMeta() {
         // No instance
     }
 
-    static public class ProviderTableMeta implements BaseColumns {
-
-        private ProviderTableMeta() {
-            // No instance
-        }
+    public static final String DB_NAME = "filelist";
+    public static final int DB_VERSION = 44;
 
+    static public class ProviderTableMeta implements BaseColumns {
         public static final String FILE_TABLE_NAME = "filelist";
         public static final String OCSHARES_TABLE_NAME = "ocshares";
         public static final String CAPABILITIES_TABLE_NAME = "capabilities";
@@ -250,5 +244,9 @@ public class ProviderMeta {
         public static final String FILESYSTEM_FILE_SENT_FOR_UPLOAD = "upload_triggered";
         public static final String FILESYSTEM_SYNCED_FOLDER_ID = "syncedfolder_id";
         public static final String FILESYSTEM_CRC32 = "crc32";
+
+        private ProviderTableMeta() {
+            // No instance
+        }
     }
 }

+ 5 - 6
src/main/java/com/owncloud/android/utils/MimeType.java

@@ -1,4 +1,4 @@
-/**
+/*
  * Nextcloud Android client application
  *
  * Copyright (C) 2016 Nextcloud
@@ -21,13 +21,12 @@ package com.owncloud.android.utils;
  * Class containing the mime types.
  */
 public class MimeType {
-
-    private MimeType() {
-        // No instance
-    }
-    
     public static final String DIRECTORY = "DIR";
     public static final String JPEG = "image/jpeg";
     public static final String TIFF = "image/tiff";
     public static final String TEXT_PLAIN = "text/plain";
+
+    private MimeType() {
+        // No instance
+    }
 }