浏览代码

Merge pull request #11456 from nextcloud/dependabot/gradle/com.mebigfatguy.fb-contrib-fb-contrib-7.6.0

Build(deps): Bump com.mebigfatguy.fb-contrib:fb-contrib from 7.4.7 to 7.6.0
Andy Scherzinger 2 年之前
父节点
当前提交
599ba0ee78

+ 1 - 1
app/build.gradle

@@ -281,7 +281,7 @@ dependencies {
     qaImplementation project(':appscan')
 
     spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
-    spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7'
+    spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.6.0'
 
     implementation "com.google.dagger:dagger:$daggerVersion"
     implementation "com.google.dagger:dagger-android:$daggerVersion"

+ 23 - 8
app/src/main/java/com/owncloud/android/ui/asynctasks/GallerySearchTask.java

@@ -43,6 +43,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import androidx.lifecycle.Lifecycle;
@@ -91,10 +92,12 @@ public class GallerySearchTask extends AsyncTask<Void, Void, GallerySearchTask.R
             searchRemoteOperation.setStartDate(0L);
 
             if (photoFragment.getContext() != null) {
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
                 Log_OC.d(this,
-                         "Start gallery search since " + dateFormat.format(new Date(endDate * 1000L)) +
-                             " with limit: " + limit);
+                         "Start gallery search since "
+                             + dateFormat.format(new Date(endDate * 1000L))
+                             + " with limit: "
+                             + limit);
                 RemoteOperationResult result = searchRemoteOperation.execute(user, photoFragment.getContext());
 
                 if (result.isSuccess()) {
@@ -136,11 +139,19 @@ public class GallerySearchTask extends AsyncTask<Void, Void, GallerySearchTask.R
         List<OCFile> localFiles = storageManager.getGalleryItems(startDate * 1000L, endDate * 1000L);
 
         if (BuildConfig.DEBUG) {
-            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Log_OC.d(this, "parseMedia - start: " + dateFormat.format(new Date(startDate * 1000L)) + " - " + dateFormat.format(new Date(endDate * 1000L)));
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
+            Log_OC.d(this,
+                     "parseMedia - start: "
+                         + dateFormat.format(new Date(startDate * 1000L))
+                         + " - "
+                         + dateFormat.format(new Date(endDate * 1000L)));
 
             for (OCFile localFile : localFiles) {
-                Log_OC.d(this, "local file: modified: " + dateFormat.format(new Date(localFile.getModificationTimestamp())) + " path: " + localFile.getRemotePath());
+                Log_OC.d(this,
+                         "local file: modified: "
+                             + dateFormat.format(new Date(localFile.getModificationTimestamp()))
+                             + " path: "
+                             + localFile.getRemotePath());
             }
         }
 
@@ -152,8 +163,12 @@ public class GallerySearchTask extends AsyncTask<Void, Void, GallerySearchTask.R
             OCFile ocFile = FileStorageUtils.fillOCFile((RemoteFile) file);
 
             if (BuildConfig.DEBUG) {
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                Log_OC.d(this, "remote file: modified: " + dateFormat.format(new Date(ocFile.getModificationTimestamp())) + " path: " + ocFile.getRemotePath());
+                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
+                Log_OC.d(this,
+                         "remote file: modified: "
+                             + dateFormat.format(new Date(ocFile.getModificationTimestamp()))
+                             + " path: "
+                             + ocFile.getRemotePath());
             }
 
             OCFile localFile = localFilesMap.remove(ocFile.getRemotePath());

+ 2 - 1
app/src/main/java/com/owncloud/android/ui/dialog/ChooseRichDocumentsTemplateDialogFragment.java

@@ -64,6 +64,7 @@ import com.owncloud.android.utils.theme.ViewThemeUtils;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 
 import javax.inject.Inject;
@@ -297,7 +298,7 @@ public class ChooseRichDocumentsTemplateDialogFragment extends DialogFragment im
 
     private void checkEnablingCreateButton() {
         Template selectedTemplate = adapter.getSelectedTemplate();
-        String name = binding.filename.getText().toString();
+        String name = Objects.requireNonNull(binding.filename.getText()).toString();
 
         positiveButton.setEnabled(selectedTemplate != null && !name.isEmpty() &&
                                       !name.equalsIgnoreCase(DOT + selectedTemplate.getExtension()));

+ 4 - 3
app/src/main/java/com/owncloud/android/ui/dialog/CreateFolderDialogFragment.java

@@ -45,6 +45,7 @@ import com.owncloud.android.utils.KeyboardUtils;
 import com.owncloud.android.utils.theme.ViewThemeUtils;
 
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 
 import javax.inject.Inject;
@@ -194,19 +195,19 @@ public class CreateFolderDialogFragment
                     .getText().toString().trim();
 
             if (TextUtils.isEmpty(newFolderName)) {
-                DisplayUtils.showSnackMessage(getActivity(), R.string.filename_empty);
+                DisplayUtils.showSnackMessage(requireActivity(), R.string.filename_empty);
                 return;
             }
 
             if (!FileUtils.isValidName(newFolderName)) {
-                DisplayUtils.showSnackMessage(getActivity(), R.string.filename_forbidden_charaters_from_server);
+                DisplayUtils.showSnackMessage(requireActivity(), R.string.filename_forbidden_charaters_from_server);
 
                 return;
             }
 
             String path = mParentFolder.getDecryptedRemotePath() + newFolderName + OCFile.PATH_SEPARATOR;
 
-            ((ComponentsGetter) getActivity()).getFileOperationsHelper().createFolder(path);
+            ((ComponentsGetter) requireActivity()).getFileOperationsHelper().createFolder(path);
         }
     }
 }

+ 6 - 6
app/src/main/java/com/owncloud/android/ui/dialog/SendShareDialog.java

@@ -163,7 +163,7 @@ public class SendShareDialog extends BottomSheetDialogFragment implements Inject
 
         List<SendButtonData> sendButtonDataList = setupSendButtonData(sendIntent);
 
-        if ("off".equalsIgnoreCase(getContext().getString(R.string.send_files_to_other_apps))) {
+        if ("off".equalsIgnoreCase(requireContext().getString(R.string.send_files_to_other_apps))) {
             sharePeopleText.setVisibility(View.GONE);
         }
 
@@ -184,13 +184,13 @@ public class SendShareDialog extends BottomSheetDialogFragment implements Inject
 
     private void shareByLink() {
         if (file.isSharedViaLink()) {
-            ((FileActivity) getActivity()).getFileOperationsHelper().getFileWithLink(file, viewThemeUtils);
+            ((FileActivity) requireActivity()).getFileOperationsHelper().getFileWithLink(file, viewThemeUtils);
         } else if (sharingPublicPasswordEnforced || sharingPublicAskForPassword) {
             // password enforced by server, request to the user before trying to create
             requestPasswordForShareViaLink();
         } else {
             // create without password if not enforced by server or we don't know if enforced;
-            ((FileActivity) getActivity()).getFileOperationsHelper().shareFileViaPublicShare(file, null);
+            ((FileActivity) requireActivity()).getFileOperationsHelper().shareFileViaPublicShare(file, null);
         }
 
         this.dismiss();
@@ -235,11 +235,11 @@ public class SendShareDialog extends BottomSheetDialogFragment implements Inject
                 // Obtain the file
                 if (file.isDown()) {
                     sendIntent.setComponent(new ComponentName(packageName, activityName));
-                    getActivity().startActivity(Intent.createChooser(sendIntent, getString(R.string.send)));
+                    requireActivity().startActivity(Intent.createChooser(sendIntent, getString(R.string.send)));
                 } else {  // Download the file
                     Log_OC.d(TAG, file.getRemotePath() + ": File must be downloaded");
-                    ((SendShareDialog.SendShareDialogDownloader) getActivity()).downloadFile(file, packageName,
-                            activityName);
+                    ((SendShareDialog.SendShareDialogDownloader) requireActivity())
+                        .downloadFile(file, packageName, activityName);
                 }
             }