8295951: intermittent cmp_baseline task failures with CDS files

Reviewed-by: iklam
This commit is contained in:
Calvin Cheung 2023-01-31 16:51:45 +00:00
parent 60c535de49
commit e193a0b72a

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -147,6 +147,12 @@ public class HelloClasslist {
invoke(handle("staticMethod_V", MethodType.methodType(void.class)));
LOGGER.log(Level.FINE, "New Date: " + newDate + " - old: " + oldDate);
// The Striped64$Cell is loaded rarely only when there's a contention among
// multiple threads performing LongAdder.increment(). This results in
// an inconsistency in the classlist between builds (see JDK-8295951).
// To avoid the problem, load the class explicitly.
Class<?> striped64Class = Class.forName("java.util.concurrent.atomic.Striped64$Cell");
}
public HelloClasslist() {}