@@ -324,29 +324,30 @@ private static void configureEntitlements(Project project) {
324324 }
325325 FileCollection bridgeFiles = bridgeConfig ;
326326
327- project .getTasks ().withType (Test .class )
327+ project .getTasks ()
328+ .withType (Test .class )
328329 .matching (test -> TEST_TASKS_WITH_ENTITLEMENTS .contains (test .getName ()))
329330 .configureEach (test -> {
330- // See also SystemJvmOptions.maybeAttachEntitlementAgent.
331+ // See also SystemJvmOptions.maybeAttachEntitlementAgent.
331332
332- // Agent
333- if (agentFiles .isEmpty () == false ) {
334- test .getInputs ().files (agentFiles );
335- test .systemProperty ("es.entitlement.agentJar" , agentFiles .getAsPath ());
336- test .systemProperty ("jdk.attach.allowAttachSelf" , true );
337- }
333+ // Agent
334+ if (agentFiles .isEmpty () == false ) {
335+ test .getInputs ().files (agentFiles );
336+ test .systemProperty ("es.entitlement.agentJar" , agentFiles .getAsPath ());
337+ test .systemProperty ("jdk.attach.allowAttachSelf" , true );
338+ }
338339
339- // Bridge
340- if (bridgeFiles .isEmpty () == false ) {
341- String modulesContainingEntitlementInstrumentation = "java.logging,java.net.http,java.naming,jdk.net" ;
342- test .getInputs ().files (bridgeFiles );
343- // Tests may not be modular, but the JDK still is
344- test .jvmArgs (
345- "--add-exports=java.base/org.elasticsearch.entitlement.bridge=ALL-UNNAMED,"
346- + modulesContainingEntitlementInstrumentation
347- );
348- }
349- });
340+ // Bridge
341+ if (bridgeFiles .isEmpty () == false ) {
342+ String modulesContainingEntitlementInstrumentation = "java.logging,java.net.http,java.naming,jdk.net" ;
343+ test .getInputs ().files (bridgeFiles );
344+ // Tests may not be modular, but the JDK still is
345+ test .jvmArgs (
346+ "--add-exports=java.base/org.elasticsearch.entitlement.bridge=ALL-UNNAMED,"
347+ + modulesContainingEntitlementInstrumentation
348+ );
349+ }
350+ });
350351 }
351352
352353}
0 commit comments