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

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

Merged
merged 11 commits into from
Dec 17, 2024

Conversation

mkarg
Copy link
Contributor

@mkarg mkarg commented Dec 12, 2024

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
Copy link
Contributor Author

mkarg commented Dec 12, 2024

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
Copy link
Contributor Author

mkarg commented Dec 12, 2024

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! 😳

Copy link
Owner

@gaul gaul left a comment

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
Copy link
Contributor Author

mkarg commented Dec 15, 2024

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
3 checks passed
@gaul
Copy link
Owner

gaul commented Dec 17, 2024

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