<i18n dev> RFR: 8314483: Optionally override copyright header in generated source [v2]

Andrey Turbanov aturbanov at openjdk.org
Fri Aug 25 06:49:10 UTC 2023


On Thu, 24 Aug 2023 17:36:46 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> In the JDK build we have various build tools that generate source code from data files. For most of these tools, the source files are based on template files, which already have copyright headers, but for some, the complete source file is generated by the tool, which is providing the copyright header programatically. For the latter, we would like to implement an override mechanism in each tool so that we can change the copyright header from a custom makefile.
>
> Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Suggestion from dholmes

make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java line 236:

> 234:                     case "-jdk-header-template":
> 235:                         jdkHeaderTemplate = new String(
> 236:                             Files.readAllBytes(Paths.get(args[++i])),

Can `java.nio.file.Files#readString(java.nio.file.Path)` be used instead?

make/jdk/src/classes/build/tools/generatelsrequivmaps/EquivMapsGenerator.java line 63:

> 61:         } else if (args.length == 5) {
> 62:             if ("-jdk-header-template".equals(args[i])) {
> 63:                 jdkHeaderTemplate = new String(Files.readAllBytes(Paths.get(args[++i])),

Can be simplified with `Files.readString(java.nio.file.Path)`

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15346#discussion_r1305246836
PR Review Comment: https://git.openjdk.org/jdk/pull/15346#discussion_r1305247477


More information about the i18n-dev mailing list