Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IO-814] Don't throw UncheckedIOException #491

Merged
merged 7 commits into from
Oct 7, 2023
Merged

Conversation

elharo
Copy link
Contributor

@elharo elharo commented Oct 6, 2023

Fortunately the API here offered a backwards compatible fix. Since it was already declared to return null for some exceptions, this makes it return null for IOException too. This reverts the behavior breaking change without adding any API changes to anyone's code.

Also some javadoc cleanups while I was in here.

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

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

Please don't change the style: Sentences start with a capital letter and end with a period.

@elharo
Copy link
Contributor Author

elharo commented Oct 6, 2023

Except they aren't sentences. They're sentence fragments, and this case is explicitly called out in the Oracle style guidelines: "When writing the comments themselves, in general, start with a phrase and follow it with sentences if they are needed. When writing a phrase, do not capitalize and do not end with a period".

If the project wants to diverge from that, it's worth calling it out explicitly in a project specific style guide.

@garydgregory
Copy link
Member

Except they aren't sentences. They're sentence fragments, and this case is explicitly called out in the Oracle style guidelines: "When writing the comments themselves, in general, start with a phrase and follow it with sentences if they are needed. When writing a phrase, do not capitalize and do not end with a period".

If the project wants to diverge from that, it's worth calling it out explicitly in a project specific style guide.

We do, under a header called "Respect The Original Style" on https://commons.apache.org/patches.html

I suppose it could go into more detail of course ;-)

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2023

Codecov Report

Merging #491 (e21541f) into master (877b9e3) will increase coverage by 0.06%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master     #491      +/-   ##
============================================
+ Coverage     84.97%   85.03%   +0.06%     
- Complexity     3372     3375       +3     
============================================
  Files           227      227              
  Lines          8080     8080              
  Branches        953      953              
============================================
+ Hits           6866     6871       +5     
+ Misses          960      957       -3     
+ Partials        254      252       -2     
Files Coverage Δ
...ain/java/org/apache/commons/io/file/PathUtils.java 72.16% <0.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@elharo
Copy link
Contributor Author

elharo commented Oct 7, 2023

Reverted Javadoc nits. PTAL

@garydgregory garydgregory merged commit 606e72f into apache:master Oct 7, 2023
12 checks passed
asfgit pushed a commit that referenced this pull request Oct 7, 2023
@elharo elharo deleted the IO-814 branch October 7, 2023 16:31
@jglick
Copy link

jglick commented Jan 29, 2024

Would a variant of the test from #478 be useful here as a regression test? Like

PathUtils.deleteFile(tempDir.resolve("nonexistent").resolve("file-does-not-exist.bin"), StandardDeleteOption.OVERRIDE_READ_ONLY));

which if I understand correctly should now return normally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants