Skip to content

Conversation

fridrich
Copy link
Contributor

@fridrich fridrich commented Oct 17, 2025

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@fridrich
Copy link
Contributor Author

Would be nice to run workflows on this just to know whether it solves what it should solve

@fridrich
Copy link
Contributor Author

I did not give much thought to the method names or pretty javadoc description. Once we are sure something like this works, I will beautify.

@fridrich
Copy link
Contributor Author

fridrich commented Oct 17, 2025

See: #1274

@fridrich
Copy link
Contributor Author

@gnodet what do you think about this one?

@gnodet gnodet self-requested a review October 17, 2025 13:21
@gnodet
Copy link
Contributor

gnodet commented Oct 17, 2025

@gnodet what do you think about this one?

I haven't looked if we cover all the needed calls to files being read or written, but this looks good at first glance.

@fridrich
Copy link
Contributor Author

what would be the best name for this method? the getDataCharset was nice for the StaleHelper, but more generic would be something like getSystemEncoding or even more accurate getEncodingToUse... I have no idea :/

@fridrich
Copy link
Contributor Author

@gnodet what do you think about this one?

I haven't looked if we cover all the needed calls to files being read or written, but this looks good at first glance.

I grepped UTF_8 and then the files that had it, I checked the different calls. If this one passes all the ITs on all platforms, I will have to beautify it and will go through all of the source files looking for usual suspects.

@fridrich
Copy link
Contributor Author

the version 25 in the matrix brings a dilemma. Groovy 5+ supports JDK11+ until 25, thus does not support JDK8. Groovy 4.x supports JDK8, but does not support JDK25.

@fridrich
Copy link
Contributor Author

@gnodet there are two occurrences of StandardCharsets.UTF_8 in JavadocUtil.java, but they have nothing to do with the filesystem encoding. In both cases, it is the encoding of maven invokerLog used to convert the byte[] resulting from reading it by Files.readAllBytes into a String. They should be left as they are IMHO.

@fridrich
Copy link
Contributor Author

@gnodet there are two occurrences of StandardCharsets.UTF_8 in JavadocUtil.java, but they have nothing to do with the filesystem encoding. In both cases, it is the encoding of maven invokerLog used to convert the byte[] resulting from reading it by Files.readAllBytes into a String. They should be left as they are IMHO.

And I was overkeen in one place in AbstractJavadocMojo.java where the situation is the same

@fridrich fridrich force-pushed the master branch 3 times, most recently from b7dbd49 to a5b547d Compare October 17, 2025 15:19
For reading and writing of data, Javadoc does expect a certain
encoding dependending on which version of JDK we use. So we have no
choice but to actually use that one. Writing only in UTF-8, will
always fail in some corner cases.
@fridrich fridrich changed the title WIP: Data charset Use consistently the encoding expected by Javadoc for reading and writing of data Oct 17, 2025
@fridrich
Copy link
Contributor Author

OK, I cleaned all the stuff and this PR is not WIP any more. I officially request review of this PR. @gnodet

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.

3 participants