Skip to content

Commit 72edf42

Browse files
committed
internal-eclipse-osgi-3.6
1 parent c775072 commit 72edf42

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

instrumentation/internal/internal-eclipse-osgi-3.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/osgi/EclipseOsgiInstrumentation.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1414
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
1515
import net.bytebuddy.asm.Advice;
16+
import net.bytebuddy.asm.Advice.AssignReturned;
1617
import net.bytebuddy.description.type.TypeDescription;
1718
import net.bytebuddy.matcher.ElementMatcher;
1819

@@ -52,13 +53,15 @@ public static boolean onEnter(@Advice.Argument(0) String packageName) {
5253
return InClassLoaderMatcher.get() && !packageName.startsWith("io.opentelemetry.");
5354
}
5455

56+
@AssignReturned.ToReturned
5557
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
56-
public static void onExit(
57-
@Advice.Return(readOnly = false) boolean result,
58-
@Advice.Enter boolean inClassLoaderMatcher) {
58+
public static boolean onExit(
59+
@Advice.Return boolean originalResult, @Advice.Enter boolean inClassLoaderMatcher) {
60+
boolean result = originalResult;
5961
if (inClassLoaderMatcher) {
6062
result = false;
6163
}
64+
return result;
6265
}
6366
}
6467
}

instrumentation/internal/internal-eclipse-osgi-3.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/osgi/EclipseOsgiInstrumentationModule.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import com.google.auto.service.AutoService;
1111
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
1212
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
13+
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
1314
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
1415
import java.util.List;
1516

1617
@AutoService(InstrumentationModule.class)
17-
public class EclipseOsgiInstrumentationModule extends InstrumentationModule {
18+
public class EclipseOsgiInstrumentationModule extends InstrumentationModule
19+
implements ExperimentalInstrumentationModule {
1820
public EclipseOsgiInstrumentationModule() {
1921
super("internal-eclipse-osgi", "internal-eclipse-osgi-3.6");
2022
}
@@ -29,4 +31,9 @@ public boolean defaultEnabled(ConfigProperties config) {
2931
public List<TypeInstrumentation> typeInstrumentations() {
3032
return singletonList(new EclipseOsgiInstrumentation());
3133
}
34+
35+
@Override
36+
public boolean isIndyReady() {
37+
return true;
38+
}
3239
}

0 commit comments

Comments
 (0)