Add the errorprone compiler.
MODIFY
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/TracerInstaller.java
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/TracerInstaller.java
@@ -26,9 +26,9 @@ public class TracerInstaller {
public static void logVersionInfo() {
// version classes log important info
// in static initializers
- DDTraceOTInfo.VERSION.toString();
- DDTraceApiInfo.VERSION.toString();
- DDJavaAgentInfo.VERSION.toString();
+ final String s = DDTraceOTInfo.VERSION.toString();
+ final String s1 = DDTraceApiInfo.VERSION.toString();
+ final String s2 = DDJavaAgentInfo.VERSION.toString();
log.debug(GlobalTracer.class.getName() + " loaded on " + GlobalTracer.class.getClassLoader());
log.debug(
AgentInstaller.class.getName() + " loaded on " + AgentInstaller.class.getClassLoader());

MODIFY
dd-trace-api/src/main/java/datadog/trace/api/DDTraceApiInfo.java
dd-trace-api/src/main/java/datadog/trace/api/DDTraceApiInfo.java
@@ -11,7 +11,7 @@ public class DDTraceApiInfo {
static {
String v;
try {
- final StringBuffer sb = new StringBuffer();
+ final StringBuilder sb = new StringBuilder();
final BufferedReader br =
new BufferedReader(

MODIFY
dd-trace-java.gradle
dd-trace-java.gradle
@@ -5,7 +5,8 @@ buildscript {
dependencies {
classpath "io.franzbecker:gradle-lombok:1.8"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.18"
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
+ classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
+ classpath "net.ltgt.gradle:gradle-errorprone-plugin:0.0.13"
}
}

MODIFY
dd-trace-ot/src/main/java/datadog/opentracing/DDTraceOTInfo.java
dd-trace-ot/src/main/java/datadog/opentracing/DDTraceOTInfo.java
@@ -15,7 +15,7 @@ public class DDTraceOTInfo {
static {
String v;
try {
- final StringBuffer sb = new StringBuffer();
+ final StringBuilder sb = new StringBuilder();
final BufferedReader br =
new BufferedReader(

MODIFY
gradle/java.gradle
gradle/java.gradle
@@ -11,6 +11,12 @@ lombok { // optional: values below are the defaults
sha256 = "c5178b18caaa1a15e17b99ba5e4023d2de2ebc18b58cde0f5a04ca4b31c10e6d"
}
+apply plugin: "net.ltgt.errorprone"
+tasks.withType(JavaCompile) {
+ // workaround for: https://github.com/google/error-prone/issues/780
+ options.compilerArgs += ['-Xep:ParameterName:OFF']
+}
+
apply plugin: "eclipse"
eclipse {
classpath {

Add the errorprone compiler.