Skip to content

Commit 6006123

Browse files
committed
fix java8
1 parent 569b517 commit 6006123

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

muzzle/src/main/java/io/opentelemetry/javaagent/tooling/HelperInjector.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,6 @@ private static Map<String, byte[]> resolve(Map<String, Supplier<byte[]>> classes
320320

321321
private static final String virtualFieldPackage =
322322
VirtualFieldAccessorMarker.class.getPackage().getName() + ".";
323-
// because all generated virtual field classes are in the same package we can use lookup to define
324-
// them
325-
private static final ClassInjector.UsingLookup virtualFieldInjector =
326-
ClassInjector.UsingLookup.of(VirtualFieldDetector.lookup());
327323

328324
private void injectBootstrapClassLoader(Map<String, Supplier<byte[]>> inject) throws IOException {
329325

@@ -333,6 +329,11 @@ private void injectBootstrapClassLoader(Map<String, Supplier<byte[]>> inject) th
333329
}
334330

335331
if (ClassInjector.UsingLookup.isAvailable()) {
332+
// because all generated virtual field classes are in the same package we can use lookup to
333+
// define them
334+
ClassInjector virtualFieldInjector =
335+
ClassInjector.UsingLookup.of(VirtualFieldDetector.lookup());
336+
336337
for (Iterator<Map.Entry<String, byte[]>> iterator = classnameToBytes.entrySet().iterator();
337338
iterator.hasNext(); ) {
338339
Map.Entry<String, byte[]> entry = iterator.next();

0 commit comments

Comments
 (0)