RFR: 8271419: Refactor test code for modifying CDS archive contents

Yumin Qi minqi at openjdk.java.net
Fri Jul 30 22:13:29 UTC 2021


On Fri, 30 Jul 2021 21:02:24 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> The code for modifying CDS archive content could be used by other tests so the common code is refactored into a util class CDSArchiveUtils.
>> 
>> Tests: tier1,tier4
>> 
>> Thanks
>> Yumin
>
> test/hotspot/jtreg/runtime/cds/appcds/SharedArchiveConsistency.java line 214:
> 
>> 212:         shareAuto = args[0].equals("auto");
>> 213:         WhiteBox box = WhiteBox.getWhiteBox();
>> 214:         CDSArchiveUtils.initialize(box);  // all offsets available
> 
> After this refactoring, I don't think WhiteBox is required in this file.
> So I think CDSArchiveUtils could create a WhiteBox instance instead of requiring the caller to supply one.

The util class is just a utility class, I have no idea if we can do this, let me try --- it might work.

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

PR: https://git.openjdk.java.net/jdk/pull/4945


More information about the hotspot-runtime-dev mailing list