File tree Expand file tree Collapse file tree
agent-jmxfetch/src/main/java/datadog/trace/agent/jmxfetch Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package datadog .trace .agent .jmxfetch ;
2+
3+ import java .io .InputStream ;
4+
5+ /**
6+ * We map the legacy {@code org.yaml.snakeyaml.Yaml} class to this substitute class at build time to
7+ * keep the GraalVM native-image builder happy. JmxFetch has a solitary reference to the class, but
8+ * it's never called because JMXFetch discovers the embedded snakeyaml-engine library and uses that.
9+ */
10+ public class LegacyYaml {
11+ public <T > T load (InputStream in ) {
12+ throw new UnsupportedOperationException ();
13+ }
14+
15+ public String dump (Object data ) {
16+ throw new UnsupportedOperationException ();
17+ }
18+ }
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ def generalShadowJarConfig(ShadowJar shadowJarTask) {
156156 // Prevents conflict with other instances, but doesn't relocate instrumentation
157157 if (! projectName. equals(' instrumentation' )) {
158158 relocate ' org.snakeyaml.engine' , ' datadog.snakeyaml.engine'
159+ relocate ' org.yaml.snakeyaml.Yaml' , ' datadog.trace.agent.jmxfetch.LegacyYaml'
159160 relocate ' okhttp3' , ' datadog.okhttp3'
160161 relocate ' okio' , ' datadog.okio'
161162
You can’t perform that action at this time.
0 commit comments