Skip to content

Commit

Permalink
Merge pull request #1763 from newrelic/msgformat-premain-load
Browse files Browse the repository at this point in the history
Add MessageFormat class to InitProblemClasses
  • Loading branch information
jtduffy authored Feb 27, 2024
2 parents ba1bd5b + c0f1fbe commit c495abc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
Expand All @@ -32,6 +33,9 @@ public static final void loadInitialClasses() {
Utils.getClassResourceName(Class.forName("java.net.URL"));
UtilityClass.class.getName();

// Force this formatter to load early to avoid a java.lang.ClassCircularityError
MessageFormat.format("{0}", 1.0);

// This is here to attempt to get around a Websphere J9 (JDK6) deadlock
ClassLoader classLoader = UtilityClass.class.getClassLoader();
classLoader.getResource(WeaveUtils.getClassResourceName(UtilityClass.class.getName()));
Expand Down

0 comments on commit c495abc

Please sign in to comment.