Skip to content

Add violations for File, Paths, FileInputStream, FileOutputStream, FileReader and FileWriter#301

Merged
gaul merged 11 commits into
gaul:masterfrom
mkarg:nio
Dec 17, 2024
Merged

Add violations for File, Paths, FileInputStream, FileOutputStream, FileReader and FileWriter#301
gaul merged 11 commits into
gaul:masterfrom
mkarg:nio

Conversation

@mkarg

@mkarg mkarg commented Dec 12, 2024

Copy link
Copy Markdown
Contributor

Modern applications should switch from NIO API to NIO2 API to allow for improved performance.

Disclaimer: I am part of the I/O performance optimization team at OpenJDK. My intention of the current PR is to evangelize its use, so applications will run more efficient.

@mkarg mkarg changed the title Add violations for File, FileInputStream, FileOutputStream, FileReader and FileWriter Add violations for File, Paths, FileInputStream, FileOutputStream, FileReader and FileWriter Dec 12, 2024
@mkarg mkarg marked this pull request as ready for review December 12, 2024 15:24
@mkarg

mkarg commented Dec 12, 2024

Copy link
Copy Markdown
Contributor Author

Tests run fine on modern JDKs, but Github Actions fail because they run on JDK 8, as Java 11 tests need JDK 11 to compile...! 🤦‍♂️

@mkarg

mkarg commented Dec 12, 2024

Copy link
Copy Markdown
Contributor Author

I have deliberately replaces some Java 11 violations that would produce a paradox situation now that Java 7 violations are in place: We should definitively not ask people to stick with IO classes in Java 11 when we ask them to switch over to NIO2 already in Java 7! 😳

@gaul gaul left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This looks like a good improvement. Could you bump the Java version to 11 in .github/workflows/ci.yml? This should retain compatibility with older JDKs since maven.compiler.source is set to 8 in pom.xml.

@mkarg

mkarg commented Dec 15, 2024

Copy link
Copy Markdown
Contributor Author

This looks like a good improvement. Could you bump the Java version to 11 in .github/workflows/ci.yml? This should retain compatibility with older JDKs since maven.compiler.source is set to 8 in pom.xml.

Done. 🙂

@mkarg mkarg requested a review from gaul December 15, 2024 22:05
@gaul gaul merged commit c2042e3 into gaul:master Dec 17, 2024
@gaul

gaul commented Dec 17, 2024

Copy link
Copy Markdown
Owner

Thank you for your contribution @mkarg!

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.

2 participants