Skip to content

Commit 3957429

Browse files
authored
Fix build (#9283)
1 parent a9d5acc commit 3957429

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/AgentInitializer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ public Boolean run() {
8181
});
8282
}
8383

84-
@SuppressWarnings({"deprecation", "removal"}) // AccessController is deprecated
84+
@SuppressWarnings("removal") // AccessController is deprecated for removal
8585
private static <T> T doPrivilegedExceptionAction(PrivilegedExceptionAction<T> action)
8686
throws Exception {
8787
return java.security.AccessController.doPrivileged(action);
8888
}
8989

90-
@SuppressWarnings({"deprecation", "removal"}) // AccessController is deprecated
90+
@SuppressWarnings("removal") // AccessController is deprecated for removal
9191
private static <T> T doPrivileged(PrivilegedAction<T> action) {
9292
return java.security.AccessController.doPrivileged(action);
9393
}

javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/instrumentation/indy/InstrumentationModuleClassLoader.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.lang.invoke.MethodHandles;
1111
import java.lang.invoke.MethodType;
1212
import java.net.URL;
13-
import java.security.AccessController;
1413
import java.security.PrivilegedAction;
1514
import java.security.ProtectionDomain;
1615
import java.util.Collections;
@@ -85,6 +84,7 @@ public MethodHandles.Lookup getLookup() {
8584
}
8685

8786
@Override
87+
@SuppressWarnings("removal") // AccessController is deprecated for removal
8888
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
8989
synchronized (getClassLoadingLock(name)) {
9090
Class<?> result = findLoadedClass(name);
@@ -98,7 +98,7 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE
9898
result = defineClassWithPackage(name, bytecode);
9999
} else {
100100
result =
101-
AccessController.doPrivileged(
101+
java.security.AccessController.doPrivileged(
102102
(PrivilegedAction<Class<?>>) () -> defineClassWithPackage(name, bytecode));
103103
}
104104
}
@@ -225,11 +225,12 @@ Package findPackage(String name) {
225225
}
226226
}
227227

228+
@SuppressWarnings("removal") // AccessController is deprecated for removal
228229
private static ProtectionDomain getProtectionDomain() {
229230
if (System.getSecurityManager() == null) {
230231
return InstrumentationModuleClassLoader.class.getProtectionDomain();
231232
}
232-
return AccessController.doPrivileged(
233+
return java.security.AccessController.doPrivileged(
233234
(PrivilegedAction<ProtectionDomain>)
234235
((Class<?>) InstrumentationModuleClassLoader.class)::getProtectionDomain);
235236
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ Class<?> inject(ClassLoader classLoader, String className) {
403403
}
404404
}
405405

406-
@SuppressWarnings({"deprecation", "removal"}) // AccessController is deprecated
406+
@SuppressWarnings("removal") // AccessController is deprecated for removal
407407
private static <T> T execute(PrivilegedAction<T> action) {
408408
if (System.getSecurityManager() != null) {
409409
return java.security.AccessController.doPrivileged(action);

0 commit comments

Comments
 (0)