Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 18 |
| Duplication | 0 |
TIP This summary will be updated as you push new changes. Give us feedback
Contributor
|
No relevant source code has been changed, pmdtester skipped. (comment created at 2026-05-07 14:03:29+00:00 for 545f8bb) |
Member
Author
|
Fixed the "new errors" from the regression report. I suspect the logic is still not quite 100% correct (e.g. static vs non-static). But I think these cases should be rare enough that we can ignore them until we see them in real life. |
3a572a3 to
501c641
Compare
18a6a8c to
402d9be
Compare
…ag-some-constructors-of-IO-related-classes
adangel
added a commit
that referenced
this pull request
May 7, 2026
adangel
added a commit
that referenced
this pull request
May 7, 2026
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.
Describe the PR
This PR changes UseStandardCharsets to not only violate use of
Charset.forName, but also looks for method calls where a charset is named by String while a similar method that takes a Charset exists.I thought about using a long list of InvocationMatchers (like in RelianceOnDefaultCharsetRule), but decided to try a different approach: The code looks for a method of the same name, where the String argument is replaced with a Charset argument. This way this should automatically work for non-JCL (like apache commons-io mentioned in the ticket) as well.
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)