77
88import static io .opentelemetry .instrumentation .test .utils .ClasspathUtils .isClassLoaded ;
99import static io .opentelemetry .instrumentation .test .utils .GcUtils .awaitGc ;
10+ import static java .util .Collections .singletonList ;
1011import static org .assertj .core .api .Assertions .assertThat ;
1112import static org .assertj .core .api .Assertions .assertThatThrownBy ;
1213
1819import java .net .URL ;
1920import java .net .URLClassLoader ;
2021import java .time .Duration ;
22+ import java .util .Arrays ;
2123import java .util .Collections ;
22- import java .util .List ;
2324import java .util .concurrent .atomic .AtomicReference ;
2425import net .bytebuddy .agent .ByteBuddyAgent ;
2526import net .bytebuddy .description .type .TypeDescription ;
@@ -36,7 +37,7 @@ void helpersInjectedToNonDelegatingClassloader() throws Exception {
3637 ClassLoader helpersSourceLoader = new URLClassLoader (helpersSourceUrls );
3738
3839 String helperClassName = HelperInjectionTest .class .getPackage ().getName () + ".HelperClass" ;
39- HelperInjector injector = new HelperInjector ("test" , List . of (helperClassName ), List . of (), helpersSourceLoader , null );
40+ HelperInjector injector = new HelperInjector ("test" , singletonList (helperClassName ), Collections . emptyList (), helpersSourceLoader , null );
4041 AtomicReference <URLClassLoader > emptyLoader = new AtomicReference <>(new URLClassLoader (new URL [0 ], null ));
4142
4243 assertThatThrownBy (() -> emptyLoader .get ().loadClass (helperClassName ))
@@ -72,8 +73,8 @@ void helpersInjectedOnBootstrapClassloader() throws Exception {
7273 String helperClassName = HelperInjectionTest .class .getPackage ().getName () + ".HelperClass" ;
7374 HelperInjector injector = new HelperInjector (
7475 "test" ,
75- List . of (helperClassName ),
76- List . of (),
76+ Arrays . asList (helperClassName ),
77+ Collections . emptyList (),
7778 this .getClass ().getClassLoader (),
7879 ByteBuddyAgent .getInstrumentation ());
7980 URLClassLoader bootstrapChild = new URLClassLoader (new URL [0 ], null );
0 commit comments