Skip to content

Commit c495abc

Browse files
authored
Merge pull request #1763 from newrelic/msgformat-premain-load
Add MessageFormat class to InitProblemClasses
2 parents ba1bd5b + c0f1fbe commit c495abc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

newrelic-agent/src/main/java/com/newrelic/agent/InitProblemClasses.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import java.lang.ref.Reference;
1616
import java.lang.ref.ReferenceQueue;
17+
import java.text.MessageFormat;
1718
import java.util.Collections;
1819
import java.util.Map;
1920
import java.util.Set;
@@ -32,6 +33,9 @@ public static final void loadInitialClasses() {
3233
Utils.getClassResourceName(Class.forName("java.net.URL"));
3334
UtilityClass.class.getName();
3435

36+
// Force this formatter to load early to avoid a java.lang.ClassCircularityError
37+
MessageFormat.format("{0}", 1.0);
38+
3539
// This is here to attempt to get around a Websphere J9 (JDK6) deadlock
3640
ClassLoader classLoader = UtilityClass.class.getClassLoader();
3741
classLoader.getResource(WeaveUtils.getClassResourceName(UtilityClass.class.getName()));

0 commit comments

Comments
 (0)