RFR: 8183348: Better cleanup for jdk/test/sun/security/pkcs12/P12SecretKey.java

Rajan Halade rhalade at openjdk.org
Thu May 1 05:02:47 UTC 2025


On Thu, 17 Apr 2025 09:51:40 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:

> * Changed the test to use scratch directory
> * Cleaned up the imports

test/jdk/sun/security/pkcs12/P12SecretKey.java line 68:

> 66: 
> 67:         // temporary files are created in scratch directory
> 68:         final File ksFile = File.createTempFile("test", ".test", new File("."));

Instead, update test to use `createTempFile` from https://github.com/openjdk/jdk/blob/master/test/lib/jdk/test/lib/Utils.java#L815. It is designed as an replacement that doesn't leave files behind in `tmp`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24718#discussion_r2069852784


More information about the security-dev mailing list