changeset 55201:7453d5007e24

8222468: [TESTBUG] vmTestbase/metaspace/flags/maxMetaspaceSize/TestDescription.java fails with java.lang.NoClassDefFoundError Summary: Preload StackTraceElement$HashedModules in test. Reviewed-by: lmesnik, dholmes
author coleenp
date Tue, 04 Jun 2019 10:29:42 -0400
parents 9c36f33b0b01
children 7c49133fc1bc
files test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp/GarbageUtils.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp/GarbageUtils.java	Tue Jun 04 07:54:16 2019 -0700
+++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/gp/GarbageUtils.java	Tue Jun 04 10:29:42 2019 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2019, 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
@@ -73,13 +73,15 @@
             }
         };
 
-        // Force loading of OOM_TYPE and calling of enum contrusctors when loading GarbageUtils class.
+        // Force loading of OOM_TYPE and calling of enum constructors when loading GarbageUtils class.
         public static final Object[] thisIsGarbageArray_theOnlyPurposeForCreatingItAndDeclaringItPublicIsToInitializeIntancesOfOOMEnumberation = new Object[] { OOM_TYPE.ANY, OOM_TYPE.HEAP, OOM_TYPE.METASPACE };
 
         // Force early loading of classes that might otherwise unexpectedly fail
         // class loading during testing due to high memory pressure.
         public static final StringWriter preloadStringWriter = new StringWriter(1);
         public static final PrintWriter preloadPrintWriter = new PrintWriter(preloadStringWriter);
+        public static final Throwable preloadThrowable = new Throwable("preload");
+        public static final StackTraceElement[] preloadStackTraceElement = preloadThrowable.getStackTrace();
 
         private GarbageUtils() {
         }