Skip to content

Conversation

alexknop
Copy link
Collaborator

@alexknop alexknop commented Sep 9, 2025

There are 16 SpotBugs under

Bad practice:
RV: Bad use of return value from method (16: 0/16/0/0)
Method ignores exceptional return value (16: 0/16/0/0)

Solution:
Leveraging the more modern java.nio.Files library and conducting these make directory, delete, etc. functions via that.
Changing a Submit to an Execute function

Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

try {
Files.createDirectories(Objects.requireNonNull(file.getParentFile()).toPath());
} catch (IOException e) {
Log_OC.e(TAG, "Could not create directory: " + Objects.requireNonNull(file.getParentFile()).getAbsolutePath(), e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If file or file.getParentFile() is null, and we catch it and then throw another one via requireNonNull, it is probably better to

  • return in catch block
  • do not have those nestet try at all?

@alexknop alexknop force-pushed the printAsyncDirectory branch from 30ad073 to 091750f Compare October 7, 2025 15:10
Copy link

github-actions bot commented Oct 7, 2025

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15595.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants