Skip to content

Commit

Permalink
Fix intermittent LogGeneratedClassesTest failures
Browse files Browse the repository at this point in the history
Fix intermittent LogGeneratedClassesTest failures by
removing use of lambda expression in static block of
InternalCRIUSupport, which avoids the unexpected
creation of lambda class files for InternalCRIUSupport
during the test.

Issue: eclipse-openj9#18556
Signed-off-by: Amarpreet Singh <[email protected]>
  • Loading branch information
singh264 committed Feb 21, 2024
1 parent da2c022 commit 63826d4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private static native void checkpointJVMImpl(String imageDir,

private static native String[] getRestoreSystemProperites();

static {
private static void initializeUnsafe() {
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
try {
Field f = Unsafe.class.getDeclaredField("theUnsafe"); //$NON-NLS-1$
Expand Down Expand Up @@ -809,6 +809,10 @@ private void registerRestoreEnvVariables() {
return;
}

if (unsafe == null) {
initializeUnsafe();
}

J9InternalCheckpointHookAPI.registerPostRestoreHook(HookMode.SINGLE_THREAD_MODE, RESTORE_ENVIRONMENT_VARIABLES_PRIORITY,
"Restore environment variables via env file: " + envFile, () -> { //$NON-NLS-1$
if (!Files.exists(this.envFile)) {
Expand Down

0 comments on commit 63826d4

Please sign in to comment.