Avoid methods relying on default locale or charset, fixes #127#128
Merged
ato merged 16 commits intoNov 14, 2025
Conversation
methods relying on default locale are charset are used. Also forbid usage of URL.equals and .hashCode which may resolve host named per DNS lookup.
String.toLowerCase(), String.toUpperCase() and String.format(...)
PrintStream.format(...) and number formatters
8193e92 to
c013b25
Compare
call String.getBytes() with charset.
to configure the charset. Use default charset for main methods when reading from stdin.
Collaborator
Author
|
The core classes are done, test classes remaining. Staying compatible with Java 8 makes the adaption not an easy task because many IO writers do not yet accept Charset parameters. |
PrintStream.format(...) and number formatters. Unify usage charset constants.
by java.nio.StandardCharsets
using classes allowing to configure the charset. Add charset to toString() methods of OutputStreams
defining character sets
Collaborator
Author
|
Ok. I'll look for the failing forbiddenAPIs run with Java 8. |
- explicetly pass Java version - ignore signatures of missing classes
Member
|
Nice improvement. Released as 3.0.2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR add the forbiddenAPIs Maven plugin and fixes many of the forbidden calls, see #127.
To run the checks, execute
mvn verifySome work is to be done.