Skip to content

Commit bf26a18

Browse files
committed
Fixing erroneous codeNarc error
codeNarc incorrectly flagged import groovy.util.Proxy as unused To work around this, I switched to referring to groovy.util.Proxy inline instead
1 parent 319b87b commit bf26a18

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dd-java-agent/src/test/groovy/datadog/trace/bootstrap/BootstrapInitializationTelemetryTest.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package datadog.trace.agent
33
import datadog.trace.bootstrap.BootstrapInitializationTelemetry
44
import datadog.trace.bootstrap.JsonBuffer
55
import spock.lang.Specification
6-
import groovy.util.Proxy
76

87
class BootstrapInitializationTelemetryTest extends Specification {
98
def initTelemetry, capture
@@ -18,7 +17,10 @@ class BootstrapInitializationTelemetryTest extends Specification {
1817
// happens it resolves the invocation against the bootstrap classloader.
1918

2019
// To side step this problem, put a Groovy Proxy around the object under test
21-
def initTelemetryProxy = new Proxy()
20+
21+
// codeNarc was incorrectly flagging "import groovy.util.Proxy" as unused,
22+
// so I had to switch to specifying the package inline instead
23+
def initTelemetryProxy = new groovy.util.Proxy()
2224
initTelemetryProxy.setAdaptee(initTelemetry)
2325

2426
this.initTelemetry = initTelemetryProxy

0 commit comments

Comments
 (0)