From d98ad6a783d9799b7293467744548f6ff8a7f40d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 May 2026 20:47:42 +0000 Subject: [PATCH 01/10] Modernize empty list creation in MixedAuthenticatorTest Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/55976625-31a0-46ed-bee0-d9ba60c784f6 Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../src/test/java/waffle/apache/MixedAuthenticatorTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/MixedAuthenticatorTest.java b/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/MixedAuthenticatorTest.java index 83d981735d..2e6da3b517 100644 --- a/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/MixedAuthenticatorTest.java +++ b/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/MixedAuthenticatorTest.java @@ -12,7 +12,7 @@ import com.sun.jna.platform.win32.SspiUtil.ManagedSecBufferDesc; import java.util.Base64; -import java.util.Collections; +import java.util.List; import javax.servlet.ServletException; @@ -353,7 +353,7 @@ void testSecurityCheckQueryString() { @Test void testCustomPrincipal() throws LifecycleException { final GenericPrincipal genericPrincipal = new GenericPrincipal("my-principal", "my-password", - Collections.emptyList()); + List.of()); final MixedAuthenticator customAuthenticator = new MixedAuthenticator() { @Override protected GenericPrincipal createPrincipal(final IWindowsIdentity windowsIdentity) { From d0de477a26a80345eb8388408d0ca6fb140598ef Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 May 2026 20:48:39 +0000 Subject: [PATCH 02/10] Finalize modernizer fix validation Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/55976625-31a0-46ed-bee0-d9ba60c784f6 Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../src/test/java/waffle/apache/MixedAuthenticatorTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/MixedAuthenticatorTest.java b/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/MixedAuthenticatorTest.java index 2e6da3b517..e50730a4fa 100644 --- a/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/MixedAuthenticatorTest.java +++ b/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/MixedAuthenticatorTest.java @@ -352,8 +352,7 @@ void testSecurityCheckQueryString() { @Test void testCustomPrincipal() throws LifecycleException { - final GenericPrincipal genericPrincipal = new GenericPrincipal("my-principal", "my-password", - List.of()); + final GenericPrincipal genericPrincipal = new GenericPrincipal("my-principal", "my-password", List.of()); final MixedAuthenticator customAuthenticator = new MixedAuthenticator() { @Override protected GenericPrincipal createPrincipal(final IWindowsIdentity windowsIdentity) { From d4c6f5a42c558c47cf408231c2425b4a9a10d419 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 May 2026 21:13:39 +0000 Subject: [PATCH 03/10] Modernize spring-security5 tests to use List.sort natural order Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/d7a92697-cd3b-434f-8691-cbf046a39019 Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../spring/DelegatingNegotiateSecurityFilterTest.java | 4 ++-- .../java/waffle/spring/NegotiateSecurityFilterTest.java | 4 ++-- .../waffle/spring/WindowsAuthenticationProviderTest.java | 6 +++--- .../java/waffle/spring/WindowsAuthenticationTokenTest.java | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java index 2273a8fc45..53793c8d1b 100644 --- a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java +++ b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java @@ -11,7 +11,7 @@ import java.util.ArrayList; import java.util.Base64; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import javax.servlet.ServletException; @@ -115,7 +115,7 @@ void testNegotiate() throws IOException, ServletException { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); diff --git a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java index 2dda7d215d..06e8480bb3 100644 --- a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java +++ b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java @@ -11,7 +11,7 @@ import java.util.ArrayList; import java.util.Base64; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import javax.servlet.ServletException; @@ -144,7 +144,7 @@ void testNegotiate() throws IOException, ServletException { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); diff --git a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java index 7ca6e1acd3..949d82d891 100644 --- a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java +++ b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.AfterEach; @@ -97,7 +97,7 @@ void testAuthenticate() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); @@ -128,7 +128,7 @@ void testAuthenticateWithCustomGrantedAuthorityFactory() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("Everyone", list.get(0)); Assertions.assertEquals("Users", list.get(1)); Assertions.assertTrue(authenticated.getPrincipal() instanceof WindowsPrincipal); diff --git a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java index d8f06a3cd3..b0eec5ea59 100644 --- a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java +++ b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.Assertions; @@ -59,7 +59,7 @@ void testWindowsAuthenticationToken() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_GROUP1", list.get(0)); Assertions.assertEquals("ROLE_GROUP2", list.get(1)); Assertions.assertEquals("ROLE_USER", list.get(2)); @@ -86,7 +86,7 @@ void testCustomGrantedAuthorityFactory() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("group1", list.get(0)); Assertions.assertEquals("group2", list.get(1)); Assertions.assertEquals(this.principal, myToken.getPrincipal()); From 72aeb1d831605139da7b92db73cf4a53b5652052 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 00:36:49 +0000 Subject: [PATCH 04/10] Modernize tomcat10 and tomcat11 MixedAuthenticatorTest empty lists Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/672aa47a-e185-45d5-8891-7c699f1dc91c Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../src/test/java/waffle/apache/MixedAuthenticatorTest.java | 4 ++-- .../src/test/java/waffle/apache/MixedAuthenticatorTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/MixedAuthenticatorTest.java b/Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/MixedAuthenticatorTest.java index f65b4ef663..0491a0f941 100644 --- a/Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/MixedAuthenticatorTest.java +++ b/Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/MixedAuthenticatorTest.java @@ -14,7 +14,7 @@ import jakarta.servlet.ServletException; import java.util.Base64; -import java.util.Collections; +import java.util.List; import mockit.Expectations; import mockit.Mocked; @@ -352,7 +352,7 @@ void testSecurityCheckQueryString() { @Test void testCustomPrincipal() throws LifecycleException { - final GenericPrincipal genericPrincipal = new GenericPrincipal("my-principal", Collections.emptyList()); + final GenericPrincipal genericPrincipal = new GenericPrincipal("my-principal", List.of()); final MixedAuthenticator customAuthenticator = new MixedAuthenticator() { @Override protected GenericPrincipal createPrincipal(final IWindowsIdentity windowsIdentity) { diff --git a/Source/JNA/waffle-tomcat11/src/test/java/waffle/apache/MixedAuthenticatorTest.java b/Source/JNA/waffle-tomcat11/src/test/java/waffle/apache/MixedAuthenticatorTest.java index c015a0dc29..6a10980b9f 100644 --- a/Source/JNA/waffle-tomcat11/src/test/java/waffle/apache/MixedAuthenticatorTest.java +++ b/Source/JNA/waffle-tomcat11/src/test/java/waffle/apache/MixedAuthenticatorTest.java @@ -14,7 +14,7 @@ import jakarta.servlet.ServletException; import java.util.Base64; -import java.util.Collections; +import java.util.List; import mockit.Expectations; import mockit.Mocked; @@ -353,7 +353,7 @@ void testSecurityCheckQueryString() { @Test void testCustomPrincipal() throws LifecycleException { - final GenericPrincipal genericPrincipal = new GenericPrincipal("my-principal", Collections.emptyList()); + final GenericPrincipal genericPrincipal = new GenericPrincipal("my-principal", List.of()); final MixedAuthenticator customAuthenticator = new MixedAuthenticator() { @Override protected GenericPrincipal createPrincipal(final IWindowsIdentity windowsIdentity) { From 87e01e48bd0e5ff85cf64b52c01d21defe75b80c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 01:44:50 +0000 Subject: [PATCH 05/10] Modernize spring-security6 tests to List.sort natural order Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/aa355aeb-1cc0-4672-8494-4cdfe4e67541 Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../spring/DelegatingNegotiateSecurityFilterTest.java | 4 ++-- .../java/waffle/spring/NegotiateSecurityFilterTest.java | 4 ++-- .../waffle/spring/WindowsAuthenticationProviderTest.java | 6 +++--- .../java/waffle/spring/WindowsAuthenticationTokenTest.java | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java index 01e90e736d..5bdf4df15e 100644 --- a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java +++ b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.Base64; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.AfterEach; @@ -115,7 +115,7 @@ void testNegotiate() throws IOException, ServletException { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); diff --git a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java index 3c91920e32..98da6555c5 100644 --- a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java +++ b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.Base64; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.AfterEach; @@ -144,7 +144,7 @@ void testNegotiate() throws IOException, ServletException { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); diff --git a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java index 7ca6e1acd3..949d82d891 100644 --- a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java +++ b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.AfterEach; @@ -97,7 +97,7 @@ void testAuthenticate() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); @@ -128,7 +128,7 @@ void testAuthenticateWithCustomGrantedAuthorityFactory() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("Everyone", list.get(0)); Assertions.assertEquals("Users", list.get(1)); Assertions.assertTrue(authenticated.getPrincipal() instanceof WindowsPrincipal); diff --git a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java index d8f06a3cd3..b0eec5ea59 100644 --- a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java +++ b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.Assertions; @@ -59,7 +59,7 @@ void testWindowsAuthenticationToken() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_GROUP1", list.get(0)); Assertions.assertEquals("ROLE_GROUP2", list.get(1)); Assertions.assertEquals("ROLE_USER", list.get(2)); @@ -86,7 +86,7 @@ void testCustomGrantedAuthorityFactory() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("group1", list.get(0)); Assertions.assertEquals("group2", list.get(1)); Assertions.assertEquals(this.principal, myToken.getPrincipal()); From a4ba8033002915037944edeb58e5f4c2b60a55f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 May 2026 02:09:26 +0000 Subject: [PATCH 06/10] Modernize demo controller to String.formatted Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/3b743252-2e7c-4072-9ed7-bbe3bdb2400c Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../src/main/java/waffle/spring/boot/demo/DemoController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/JNA/waffle-demo-jakarta/waffle-demo-spring-boot-filter3/src/main/java/waffle/spring/boot/demo/DemoController.java b/Source/JNA/waffle-demo-jakarta/waffle-demo-spring-boot-filter3/src/main/java/waffle/spring/boot/demo/DemoController.java index 9d0297980b..680093e4dc 100644 --- a/Source/JNA/waffle-demo-jakarta/waffle-demo-spring-boot-filter3/src/main/java/waffle/spring/boot/demo/DemoController.java +++ b/Source/JNA/waffle-demo-jakarta/waffle-demo-spring-boot-filter3/src/main/java/waffle/spring/boot/demo/DemoController.java @@ -29,7 +29,7 @@ public class DemoController { */ @GetMapping public String demo(final Authentication auth) { - return String.format("Hello, %s. You have authorities: %s", auth.getPrincipal(), + return "Hello, %s. You have authorities: %s".formatted(auth.getPrincipal(), auth.getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.joining(", "))); } From 9d30bbdd4d042f1e75f4cca68fe4bf0ec86926ad Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 May 2026 17:05:41 +0000 Subject: [PATCH 07/10] Modernize spring-security7 test list sorting Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/94a08263-afe8-4eb2-9e83-10faf5871464 Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../spring/DelegatingNegotiateSecurityFilterTest.java | 4 ++-- .../java/waffle/spring/NegotiateSecurityFilterTest.java | 4 ++-- .../waffle/spring/WindowsAuthenticationProviderTest.java | 6 +++--- .../java/waffle/spring/WindowsAuthenticationTokenTest.java | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java b/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java index 01e90e736d..5bdf4df15e 100644 --- a/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java +++ b/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/DelegatingNegotiateSecurityFilterTest.java @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.Base64; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.AfterEach; @@ -115,7 +115,7 @@ void testNegotiate() throws IOException, ServletException { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); diff --git a/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java b/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java index 3c91920e32..98da6555c5 100644 --- a/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java +++ b/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/NegotiateSecurityFilterTest.java @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.Base64; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.AfterEach; @@ -144,7 +144,7 @@ void testNegotiate() throws IOException, ServletException { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); diff --git a/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java b/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java index 7ca6e1acd3..949d82d891 100644 --- a/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java +++ b/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/WindowsAuthenticationProviderTest.java @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.AfterEach; @@ -97,7 +97,7 @@ void testAuthenticate() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_EVERYONE", list.get(0)); Assertions.assertEquals("ROLE_USER", list.get(1)); Assertions.assertEquals("ROLE_USERS", list.get(2)); @@ -128,7 +128,7 @@ void testAuthenticateWithCustomGrantedAuthorityFactory() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("Everyone", list.get(0)); Assertions.assertEquals("Users", list.get(1)); Assertions.assertTrue(authenticated.getPrincipal() instanceof WindowsPrincipal); diff --git a/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java b/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java index d8f06a3cd3..b0eec5ea59 100644 --- a/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java +++ b/Source/JNA/waffle-spring-security7/src/test/java/waffle/spring/WindowsAuthenticationTokenTest.java @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; +import java.util.Comparator; import java.util.List; import org.junit.jupiter.api.Assertions; @@ -59,7 +59,7 @@ void testWindowsAuthenticationToken() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("ROLE_GROUP1", list.get(0)); Assertions.assertEquals("ROLE_GROUP2", list.get(1)); Assertions.assertEquals("ROLE_USER", list.get(2)); @@ -86,7 +86,7 @@ void testCustomGrantedAuthorityFactory() { for (final GrantedAuthority grantedAuthority : authorities) { list.add(grantedAuthority.getAuthority()); } - Collections.sort(list); + list.sort(Comparator.naturalOrder()); Assertions.assertEquals("group1", list.get(0)); Assertions.assertEquals("group2", list.get(1)); Assertions.assertEquals(this.principal, myToken.getPrincipal()); From 06ac8b862220b1fb78a45d9d4cd2bfbdb1db1f21 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 May 2026 17:28:39 +0000 Subject: [PATCH 08/10] Modernize filter4 DemoController string formatting Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/48d6eead-a29e-43f8-9ac6-26c3277c7c4e Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../src/main/java/waffle/spring/boot/demo/DemoController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/JNA/waffle-demo-jakarta/waffle-demo-spring-boot-filter4/src/main/java/waffle/spring/boot/demo/DemoController.java b/Source/JNA/waffle-demo-jakarta/waffle-demo-spring-boot-filter4/src/main/java/waffle/spring/boot/demo/DemoController.java index 9d0297980b..680093e4dc 100644 --- a/Source/JNA/waffle-demo-jakarta/waffle-demo-spring-boot-filter4/src/main/java/waffle/spring/boot/demo/DemoController.java +++ b/Source/JNA/waffle-demo-jakarta/waffle-demo-spring-boot-filter4/src/main/java/waffle/spring/boot/demo/DemoController.java @@ -29,7 +29,7 @@ public class DemoController { */ @GetMapping public String demo(final Authentication auth) { - return String.format("Hello, %s. You have authorities: %s", auth.getPrincipal(), + return "Hello, %s. You have authorities: %s".formatted(auth.getPrincipal(), auth.getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.joining(", "))); } From 8f2511060a7c1b97a00b8bb6aafa01acea481f9c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 May 2026 18:01:43 +0000 Subject: [PATCH 09/10] Modernize shiro group map setup Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/e1e6b307-2fc4-426c-99dd-05ef9a8447b2 Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../test/java/waffle/shiro/GroupMappingWaffleRealmTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/JNA/waffle-shiro/src/test/java/waffle/shiro/GroupMappingWaffleRealmTest.java b/Source/JNA/waffle-shiro/src/test/java/waffle/shiro/GroupMappingWaffleRealmTest.java index 1305717363..879242e839 100644 --- a/Source/JNA/waffle-shiro/src/test/java/waffle/shiro/GroupMappingWaffleRealmTest.java +++ b/Source/JNA/waffle-shiro/src/test/java/waffle/shiro/GroupMappingWaffleRealmTest.java @@ -11,7 +11,7 @@ import com.sun.jna.platform.win32.Secur32.EXTENDED_NAME_FORMAT; import com.sun.jna.platform.win32.Secur32Util; -import java.util.Collections; +import java.util.Map; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; @@ -46,7 +46,7 @@ void setUp() { this.windowsAuthProvider = new MockWindowsAuthProvider(); this.realm = new GroupMappingWaffleRealm(); this.realm.setProvider(this.windowsAuthProvider); - this.realm.setGroupRolesMap(Collections.singletonMap("Users", GroupMappingWaffleRealmTest.ROLE_NAME)); + this.realm.setGroupRolesMap(Map.of("Users", GroupMappingWaffleRealmTest.ROLE_NAME)); } /** From a45d79280c1e52230f3882ecdd88f2db56755fa6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 May 2026 19:11:54 +0000 Subject: [PATCH 10/10] Modernize shiro-jakarta group map setup Agent-Logs-Url: https://github.com/Waffle/waffle/sessions/20d0dbb5-d103-4da4-8cb9-752e2ee6d444 Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com> --- .../test/java/waffle/shiro/GroupMappingWaffleRealmTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/JNA/waffle-shiro-jakarta/src/test/java/waffle/shiro/GroupMappingWaffleRealmTest.java b/Source/JNA/waffle-shiro-jakarta/src/test/java/waffle/shiro/GroupMappingWaffleRealmTest.java index 1305717363..879242e839 100644 --- a/Source/JNA/waffle-shiro-jakarta/src/test/java/waffle/shiro/GroupMappingWaffleRealmTest.java +++ b/Source/JNA/waffle-shiro-jakarta/src/test/java/waffle/shiro/GroupMappingWaffleRealmTest.java @@ -11,7 +11,7 @@ import com.sun.jna.platform.win32.Secur32.EXTENDED_NAME_FORMAT; import com.sun.jna.platform.win32.Secur32Util; -import java.util.Collections; +import java.util.Map; import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationInfo; @@ -46,7 +46,7 @@ void setUp() { this.windowsAuthProvider = new MockWindowsAuthProvider(); this.realm = new GroupMappingWaffleRealm(); this.realm.setProvider(this.windowsAuthProvider); - this.realm.setGroupRolesMap(Collections.singletonMap("Users", GroupMappingWaffleRealmTest.ROLE_NAME)); + this.realm.setGroupRolesMap(Map.of("Users", GroupMappingWaffleRealmTest.ROLE_NAME)); } /**