[jdk8u-dev] RFR: 8298108: Add a regression test for JDK-8297684
Severin Gehwolf
sgehwolf at openjdk.org
Tue Apr 4 18:51:16 UTC 2023
On Tue, 4 Apr 2023 18:07:39 GMT, Andrew John Hughes <andrew at openjdk.org> wrote:
>> Please review this backport of the regression test for a critical fix which we've included with the January CPU update. The fix was https://bugs.openjdk.org/browse/JDK-8280890
>>
>> This patch adds an additional regression test which was seen in the wild with JDK 17. The patch isn't clean since the test library in jdk8u is different so needed a bit of a different setup routine for getting the jar with the provider created. Additionally, in jdk 8 the property to add providers is setting `java.ext.dirs=...` over `java.locale.providers=SPI` in later JDKs.
>>
>> Testing: The test passes for me on the current dev tree and fails with the fix from JDK-8280890 reverted.
>>
>> Thoughts?
>
> jdk/test/java/security/SignedJar/spi-calendar-provider/TestSPISigned.java line 108:
>
>> 106: List<String> testRun = new ArrayList<>();
>> 107: String extDir = System.getProperty("java.home") + File.separator + "lib" + File.separator + "ext";
>> 108: testRun.add("-Djava.ext.dirs=" + System.getProperty("java.home") + extDir + File.pathSeparator + MODS_DIR.toAbsolutePath().toString());
>
> Doesn't this add `System.getProperty("java.home")` to the front of `extDir` which already begins with `System.getProperty("java.home")`?
If you override the property, it will only contain what you pass it:
$ /usr/lib/jvm/java-1.8.0-openjdk/bin/java -Djava.ext.dirs=/foo -XshowSettings:properties -version 2>&1 | grep java.ext.dirs
java.ext.dirs = /foo
$ /usr/lib/jvm/java-1.8.0-openjdk/bin/java -XshowSettings:properties -version 2>&1 | grep java.ext.dirs
java.ext.dirs = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b09-2.fc37.x86_64/jre/lib/ext
The intention is to use the extra dir as well, but it should also use `${java.home}/ext`
-------------
PR Review Comment: https://git.openjdk.org/jdk8u-dev/pull/269#discussion_r1157639335
More information about the jdk8u-dev
mailing list