<i18n dev> RFR: 8315444: Convert test/jdk/tools to Classfile API [v2]

Chen Liang liach at openjdk.org
Tue Sep 5 23:38:41 UTC 2023


On Tue, 5 Sep 2023 16:05:14 GMT, Qing Xiao <duke at openjdk.org> wrote:

>> `/test/jdk/tools/lib/tests/JImageValidator.java`, tests in `/test/jdk/tools/jlink`, and `/test/jdk/tools/jimage`, `/test/jdk/java/time/nontestng/java/time/chrono/HijrahConfigTest.java` use on com.sun.tools.classfile and should be converted to Classfile API.
>
> Qing Xiao has updated the pull request incrementally with one additional commit since the last revision:
> 
>   migrate test/jdk/java/time/nontestng/java/time/chrono/HijrahConfigTest.java use Classfile API

In addition, I don't think we should open the `classfile.impl` package to tests; this package is not meant to be exported.

test/jdk/tools/lib/tests/JImageValidator.java line 225:

> 223: 
> 224:     public static void readClass(byte[] clazz) throws IOException {
> 225:         Classfile.of().parse(clazz);

Notice that the old API might throw different exceptions compared to the new one; the new one is lazy, e.g. if there's broken interface entry but the interfaces are not queried, no exception is thrown.

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

PR Comment: https://git.openjdk.org/jdk/pull/15529#issuecomment-1707443036
PR Review Comment: https://git.openjdk.org/jdk/pull/15529#discussion_r1316517689


More information about the i18n-dev mailing list