From eacbfd61f95e4574b79c77b372e527523d89a21f Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Sun, 21 Jan 2024 19:53:34 -0500 Subject: [PATCH 01/13] [cleanup] Remove redundant finals --- .../src/test/java/waffle/jaas/GroupPrincipalTest.java | 2 +- .../src/test/java/waffle/jaas/RolePrincipalTest.java | 2 +- .../src/test/java/waffle/jaas/UserPrincipalTest.java | 2 +- .../waffle/servlet/spi/SecurityFilterProvider.java | 10 +++++----- .../src/test/java/waffle/jaas/RolePrincipalTest.java | 2 +- .../src/test/java/waffle/jaas/UserPrincipalTest.java | 2 +- .../test/java/waffle/servlet/WindowsPrincipalTest.java | 2 +- .../test/java/waffle/servlet/WindowsPrincipalTest.java | 2 +- .../test/java/waffle/apache/WindowsAccountTest.java | 2 +- .../test/java/waffle/apache/WindowsAccountTest.java | 2 +- .../test/java/waffle/apache/WindowsAccountTest.java | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/GroupPrincipalTest.java b/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/GroupPrincipalTest.java index 57fe333f76..6d5f350105 100644 --- a/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/GroupPrincipalTest.java +++ b/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/GroupPrincipalTest.java @@ -91,7 +91,7 @@ void testEquals_Symmetric() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.groupPrincipal); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/RolePrincipalTest.java b/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/RolePrincipalTest.java index 0e7b4b9726..0f24e8b91b 100644 --- a/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/RolePrincipalTest.java +++ b/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/RolePrincipalTest.java @@ -91,7 +91,7 @@ void testEquals_Symmetric() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.rolePrincipal); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/UserPrincipalTest.java b/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/UserPrincipalTest.java index a1acdf617c..ed7606dd7a 100644 --- a/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/UserPrincipalTest.java +++ b/Source/JNA/waffle-jna-jakarta/src/test/java/waffle/jaas/UserPrincipalTest.java @@ -91,7 +91,7 @@ void testEquals_Symmetric() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.userPrincipal); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-jna/src/main/java/waffle/servlet/spi/SecurityFilterProvider.java b/Source/JNA/waffle-jna/src/main/java/waffle/servlet/spi/SecurityFilterProvider.java index 7542a58b18..ab67666ee9 100644 --- a/Source/JNA/waffle-jna/src/main/java/waffle/servlet/spi/SecurityFilterProvider.java +++ b/Source/JNA/waffle-jna/src/main/java/waffle/servlet/spi/SecurityFilterProvider.java @@ -41,7 +41,7 @@ public interface SecurityFilterProvider { * @param response * Http Response. */ - void sendUnauthorized(final HttpServletResponse response); + void sendUnauthorized(HttpServletResponse response); /** * Returns true if despite having a principal authentication needs to happen. @@ -51,7 +51,7 @@ public interface SecurityFilterProvider { * * @return True if authentication is required. */ - boolean isPrincipalException(final HttpServletRequest request); + boolean isPrincipalException(HttpServletRequest request); /** * Execute filter. @@ -67,7 +67,7 @@ public interface SecurityFilterProvider { * @throws IOException * on doFilter. */ - IWindowsIdentity doFilter(final HttpServletRequest request, final HttpServletResponse response) throws IOException; + IWindowsIdentity doFilter(HttpServletRequest request, HttpServletResponse response) throws IOException; /** * Tests whether a specific security package is supported. @@ -77,7 +77,7 @@ public interface SecurityFilterProvider { * * @return True if the security package is supported, false otherwise. */ - boolean isSecurityPackageSupported(final String securityPackage); + boolean isSecurityPackageSupported(String securityPackage); /** * Init a parameter. @@ -87,5 +87,5 @@ public interface SecurityFilterProvider { * @param parameterValue * Parameter value. */ - void initParameter(final String parameterName, final String parameterValue); + void initParameter(String parameterName, String parameterValue); } diff --git a/Source/JNA/waffle-jna/src/test/java/waffle/jaas/RolePrincipalTest.java b/Source/JNA/waffle-jna/src/test/java/waffle/jaas/RolePrincipalTest.java index 0e7b4b9726..0f24e8b91b 100644 --- a/Source/JNA/waffle-jna/src/test/java/waffle/jaas/RolePrincipalTest.java +++ b/Source/JNA/waffle-jna/src/test/java/waffle/jaas/RolePrincipalTest.java @@ -91,7 +91,7 @@ void testEquals_Symmetric() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.rolePrincipal); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-jna/src/test/java/waffle/jaas/UserPrincipalTest.java b/Source/JNA/waffle-jna/src/test/java/waffle/jaas/UserPrincipalTest.java index a1acdf617c..ed7606dd7a 100644 --- a/Source/JNA/waffle-jna/src/test/java/waffle/jaas/UserPrincipalTest.java +++ b/Source/JNA/waffle-jna/src/test/java/waffle/jaas/UserPrincipalTest.java @@ -91,7 +91,7 @@ void testEquals_Symmetric() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.userPrincipal); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WindowsPrincipalTest.java b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WindowsPrincipalTest.java index 9a003ad401..58f1f8f050 100644 --- a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WindowsPrincipalTest.java +++ b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WindowsPrincipalTest.java @@ -68,7 +68,7 @@ void setUp() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.windowsPrincipal); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WindowsPrincipalTest.java b/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WindowsPrincipalTest.java index 9a003ad401..58f1f8f050 100644 --- a/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WindowsPrincipalTest.java +++ b/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WindowsPrincipalTest.java @@ -68,7 +68,7 @@ void setUp() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.windowsPrincipal); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/WindowsAccountTest.java b/Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/WindowsAccountTest.java index 95a5135aaf..fb696f12d2 100644 --- a/Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/WindowsAccountTest.java +++ b/Source/JNA/waffle-tomcat10/src/test/java/waffle/apache/WindowsAccountTest.java @@ -80,7 +80,7 @@ void testEquals() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.windowsAccount); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-tomcat85/src/test/java/waffle/apache/WindowsAccountTest.java b/Source/JNA/waffle-tomcat85/src/test/java/waffle/apache/WindowsAccountTest.java index 95a5135aaf..fb696f12d2 100644 --- a/Source/JNA/waffle-tomcat85/src/test/java/waffle/apache/WindowsAccountTest.java +++ b/Source/JNA/waffle-tomcat85/src/test/java/waffle/apache/WindowsAccountTest.java @@ -80,7 +80,7 @@ void testEquals() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.windowsAccount); } assertThat(out.toByteArray()).isNotEmpty(); diff --git a/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/WindowsAccountTest.java b/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/WindowsAccountTest.java index 95a5135aaf..fb696f12d2 100644 --- a/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/WindowsAccountTest.java +++ b/Source/JNA/waffle-tomcat9/src/test/java/waffle/apache/WindowsAccountTest.java @@ -80,7 +80,7 @@ void testEquals() { void testIsSerializable() throws IOException, ClassNotFoundException { // serialize final ByteArrayOutputStream out = new ByteArrayOutputStream(); - try (final ObjectOutputStream oos = new ObjectOutputStream(out)) { + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(this.windowsAccount); } assertThat(out.toByteArray()).isNotEmpty(); From 2872e6f8ad9276e17f5ef218dfe3c627266fe98b Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Sun, 21 Jan 2024 19:52:23 -0500 Subject: [PATCH 02/13] [docs] Cleanup some javadocs --- .../waffle-jna/src/main/java/waffle/util/WaffleInfo.java | 8 ++++---- .../shiro/negotiate/NegotiateAuthenticationFilter.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/JNA/waffle-jna/src/main/java/waffle/util/WaffleInfo.java b/Source/JNA/waffle-jna/src/main/java/waffle/util/WaffleInfo.java index 90273fde34..7139d81903 100644 --- a/Source/JNA/waffle-jna/src/main/java/waffle/util/WaffleInfo.java +++ b/Source/JNA/waffle-jna/src/main/java/waffle/util/WaffleInfo.java @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2010-2022 The Waffle Project Contributors: https://github.com/Waffle/waffle/graphs/contributors + * Copyright (c) 2010-2024 The Waffle Project Contributors: https://github.com/Waffle/waffle/graphs/contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,7 +68,7 @@ *
  * This utility class collects system information and returns it as an XML document.
  * 
- * + *

* From the command line, you can write the info to stdout using: * *

@@ -76,7 +76,7 @@
  *   java -cp "jna.jar;waffle-core.jar;waffle-api.jar;jna-platform.jar;guava-21.0.jar" waffle.util.WaffleInfo
  * 
  * 
- * + *

* To show this information in a browser, run: * *

@@ -84,7 +84,7 @@
  *   java -cp "..." waffle.util.WaffleInfo -show
  * 
  * 
- * + *

* To lookup account names and return any listed info, run: * *

diff --git a/Source/JNA/waffle-shiro/src/main/java/waffle/shiro/negotiate/NegotiateAuthenticationFilter.java b/Source/JNA/waffle-shiro/src/main/java/waffle/shiro/negotiate/NegotiateAuthenticationFilter.java
index 07ca64a655..372ba70ac7 100644
--- a/Source/JNA/waffle-shiro/src/main/java/waffle/shiro/negotiate/NegotiateAuthenticationFilter.java
+++ b/Source/JNA/waffle-shiro/src/main/java/waffle/shiro/negotiate/NegotiateAuthenticationFilter.java
@@ -48,7 +48,7 @@
 
 /**
  * A authentication filter that implements the HTTP Negotiate mechanism. The current user is authenticated, providing
- * single-sign-on Derived from net.skorgenes.security.jsecurity.negotiate.NegotiateAuthenticationFilter. see:
+ * single-sign-on. Derived from net.skorgenes.security.jsecurity.negotiate.NegotiateAuthenticationFilter. see:
  * https://bitbucket.org/lothor
  * /shiro-negotiate/src/7b25efde130b9cbcacf579b3f926c532d919aa23/src/main/java/net/skorgenes/
  * security/jsecurity/negotiate/NegotiateAuthenticationFilter.java?at=default

From 562f5bb20467aaa01a0e5ac9151800ded14f94ce Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:50:41 -0500
Subject: [PATCH 03/13] [order] Group overrides together

---
 .../java/waffle/servlet/WindowsPrincipal.java  | 18 +++++++++---------
 .../waffle/apache/GenericWindowsPrincipal.java | 18 +++++++++---------
 .../waffle/apache/GenericWindowsPrincipal.java | 18 +++++++++---------
 .../waffle/apache/GenericWindowsPrincipal.java | 18 +++++++++---------
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/Source/JNA/waffle-jna/src/main/java/waffle/servlet/WindowsPrincipal.java b/Source/JNA/waffle-jna/src/main/java/waffle/servlet/WindowsPrincipal.java
index 34755f820d..a0ffa847fc 100644
--- a/Source/JNA/waffle-jna/src/main/java/waffle/servlet/WindowsPrincipal.java
+++ b/Source/JNA/waffle-jna/src/main/java/waffle/servlet/WindowsPrincipal.java
@@ -129,6 +129,15 @@ private static Map getGroups(final IWindowsAccount[] gro
         return groupMap;
     }
 
+    /**
+     * Windows groups that the user is a member of.
+     *
+     * @return A map of group names to groups.
+     */
+    public Map getGroups() {
+        return this.groups;
+    }
+
     /**
      * Byte representation of the SID.
      *
@@ -147,15 +156,6 @@ public String getSidString() {
         return this.sidString;
     }
 
-    /**
-     * Windows groups that the user is a member of.
-     *
-     * @return A map of group names to groups.
-     */
-    public Map getGroups() {
-        return this.groups;
-    }
-
     /**
      * Returns a list of role principal objects.
      *
diff --git a/Source/JNA/waffle-tomcat10/src/main/java/waffle/apache/GenericWindowsPrincipal.java b/Source/JNA/waffle-tomcat10/src/main/java/waffle/apache/GenericWindowsPrincipal.java
index 2a83705d2b..57e7f686ca 100644
--- a/Source/JNA/waffle-tomcat10/src/main/java/waffle/apache/GenericWindowsPrincipal.java
+++ b/Source/JNA/waffle-tomcat10/src/main/java/waffle/apache/GenericWindowsPrincipal.java
@@ -108,6 +108,15 @@ private static Map getGroups(final IWindowsAccount[] gro
         return groupMap;
     }
 
+    /**
+     * Windows groups that the user is a member of.
+     *
+     * @return A map of group names to groups.
+     */
+    public Map getGroups() {
+        return this.groups;
+    }
+
     /**
      * Byte representation of the SID.
      *
@@ -126,15 +135,6 @@ public String getSidString() {
         return this.sidString;
     }
 
-    /**
-     * Windows groups that the user is a member of.
-     *
-     * @return A map of group names to groups.
-     */
-    public Map getGroups() {
-        return this.groups;
-    }
-
     /**
      * Returns a list of role principal objects.
      *
diff --git a/Source/JNA/waffle-tomcat85/src/main/java/waffle/apache/GenericWindowsPrincipal.java b/Source/JNA/waffle-tomcat85/src/main/java/waffle/apache/GenericWindowsPrincipal.java
index 300c3e4fd8..014e0fc194 100644
--- a/Source/JNA/waffle-tomcat85/src/main/java/waffle/apache/GenericWindowsPrincipal.java
+++ b/Source/JNA/waffle-tomcat85/src/main/java/waffle/apache/GenericWindowsPrincipal.java
@@ -109,6 +109,15 @@ private static Map getGroups(final IWindowsAccount[] gro
         return groupMap;
     }
 
+    /**
+     * Windows groups that the user is a member of.
+     *
+     * @return A map of group names to groups.
+     */
+    public Map getGroups() {
+        return this.groups;
+    }
+
     /**
      * Byte representation of the SID.
      *
@@ -127,15 +136,6 @@ public String getSidString() {
         return this.sidString;
     }
 
-    /**
-     * Windows groups that the user is a member of.
-     *
-     * @return A map of group names to groups.
-     */
-    public Map getGroups() {
-        return this.groups;
-    }
-
     /**
      * Returns a list of role principal objects.
      *
diff --git a/Source/JNA/waffle-tomcat9/src/main/java/waffle/apache/GenericWindowsPrincipal.java b/Source/JNA/waffle-tomcat9/src/main/java/waffle/apache/GenericWindowsPrincipal.java
index 300c3e4fd8..014e0fc194 100644
--- a/Source/JNA/waffle-tomcat9/src/main/java/waffle/apache/GenericWindowsPrincipal.java
+++ b/Source/JNA/waffle-tomcat9/src/main/java/waffle/apache/GenericWindowsPrincipal.java
@@ -109,6 +109,15 @@ private static Map getGroups(final IWindowsAccount[] gro
         return groupMap;
     }
 
+    /**
+     * Windows groups that the user is a member of.
+     *
+     * @return A map of group names to groups.
+     */
+    public Map getGroups() {
+        return this.groups;
+    }
+
     /**
      * Byte representation of the SID.
      *
@@ -127,15 +136,6 @@ public String getSidString() {
         return this.sidString;
     }
 
-    /**
-     * Windows groups that the user is a member of.
-     *
-     * @return A map of group names to groups.
-     */
-    public Map getGroups() {
-        return this.groups;
-    }
-
     /**
      * Returns a list of role principal objects.
      *

From bbcdae13913b977a9da041d5ba34db78fcb974e1 Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:45:44 -0500
Subject: [PATCH 04/13] [cleanup] Remove WString as not needed in usage

---
 .../src/test/java/waffle/spring/ImpersonateTest.java  |  5 ++---
 .../src/test/java/waffle/spring/ImpersonateTest.java  |  5 ++---
 .../src/test/java/waffle/servlet/ImpersonateTest.java |  5 ++---
 .../waffle/windows/auth/WindowsAuthProviderTest.java  |  9 ++++-----
 .../src/test/java/waffle/servlet/ImpersonateTest.java |  5 ++---
 .../waffle/windows/auth/WindowsAuthProviderTest.java  | 11 +++++------
 6 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/ImpersonateTest.java b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/ImpersonateTest.java
index 057d35c1f7..68c5b28b98 100644
--- a/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/ImpersonateTest.java
+++ b/Source/JNA/waffle-spring-security5/src/test/java/waffle/spring/ImpersonateTest.java
@@ -25,7 +25,6 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import com.sun.jna.WString;
 import com.sun.jna.platform.win32.Advapi32Util;
 import com.sun.jna.platform.win32.LMAccess;
 import com.sun.jna.platform.win32.LMErr;
@@ -78,8 +77,8 @@ void setUp() {
         this.filter.setProvider(new SecurityFilterProviderCollection(new WindowsAuthProviderImpl()));
 
         this.userInfo = new LMAccess.USER_INFO_1();
-        this.userInfo.usri1_name = new WString(MockWindowsAccount.TEST_USER_NAME).toString();
-        this.userInfo.usri1_password = new WString(MockWindowsAccount.TEST_PASSWORD).toString();
+        this.userInfo.usri1_name = MockWindowsAccount.TEST_USER_NAME;
+        this.userInfo.usri1_password = MockWindowsAccount.TEST_PASSWORD;
         this.userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
 
         this.resultOfNetAddUser = Netapi32.INSTANCE.NetUserAdd(null, 1, this.userInfo, null);
diff --git a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/ImpersonateTest.java b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/ImpersonateTest.java
index 1c576229ac..dfd03f15a9 100644
--- a/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/ImpersonateTest.java
+++ b/Source/JNA/waffle-spring-security6/src/test/java/waffle/spring/ImpersonateTest.java
@@ -25,7 +25,6 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import com.sun.jna.WString;
 import com.sun.jna.platform.win32.Advapi32Util;
 import com.sun.jna.platform.win32.LMAccess;
 import com.sun.jna.platform.win32.LMErr;
@@ -78,8 +77,8 @@ void setUp() {
         this.filter.setProvider(new SecurityFilterProviderCollection(new WindowsAuthProviderImpl()));
 
         this.userInfo = new LMAccess.USER_INFO_1();
-        this.userInfo.usri1_name = new WString(MockWindowsAccount.TEST_USER_NAME).toString();
-        this.userInfo.usri1_password = new WString(MockWindowsAccount.TEST_PASSWORD).toString();
+        this.userInfo.usri1_name = MockWindowsAccount.TEST_USER_NAME;
+        this.userInfo.usri1_password = MockWindowsAccount.TEST_PASSWORD;
         this.userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
 
         this.resultOfNetAddUser = Netapi32.INSTANCE.NetUserAdd(null, 1, this.userInfo, null);
diff --git a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/ImpersonateTest.java b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/ImpersonateTest.java
index 5e9d667141..e90ba6b235 100644
--- a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/ImpersonateTest.java
+++ b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/ImpersonateTest.java
@@ -23,7 +23,6 @@
  */
 package waffle.servlet;
 
-import com.sun.jna.WString;
 import com.sun.jna.platform.win32.Advapi32Util;
 import com.sun.jna.platform.win32.LMAccess;
 import com.sun.jna.platform.win32.LMErr;
@@ -78,8 +77,8 @@ void setUp() {
         }
 
         this.userInfo = new LMAccess.USER_INFO_1();
-        this.userInfo.usri1_name = new WString(MockWindowsAccount.TEST_USER_NAME).toString();
-        this.userInfo.usri1_password = new WString(MockWindowsAccount.TEST_PASSWORD).toString();
+        this.userInfo.usri1_name = MockWindowsAccount.TEST_USER_NAME;
+        this.userInfo.usri1_password = MockWindowsAccount.TEST_PASSWORD;
         this.userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
 
         this.resultOfNetAddUser = Netapi32.INSTANCE.NetUserAdd(null, 1, this.userInfo, null);
diff --git a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
index 4d81fcfac9..f7fb68a5b5 100644
--- a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
+++ b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
@@ -25,7 +25,6 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import com.sun.jna.WString;
 import com.sun.jna.platform.win32.Advapi32Util;
 import com.sun.jna.platform.win32.LMAccess;
 import com.sun.jna.platform.win32.LMErr;
@@ -80,8 +79,8 @@ void testLogonGuestUser() {
     @Test
     void testLogonUser() {
         final LMAccess.USER_INFO_1 userInfo = new LMAccess.USER_INFO_1();
-        userInfo.usri1_name = new WString("WaffleTestUser").toString();
-        userInfo.usri1_password = new WString("!WAFFLEP$$Wrd0").toString();
+        userInfo.usri1_name = "WaffleTestUser";
+        userInfo.usri1_password = "!WAFFLEP$$Wrd0";
         userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
         // ignore test if not able to add user (need to be administrator to do this).
         Assumptions.assumeTrue(LMErr.NERR_Success == Netapi32.INSTANCE.NetUserAdd(null, 1, userInfo, null));
@@ -102,8 +101,8 @@ void testLogonUser() {
     @Test
     void testImpersonateLoggedOnUser() {
         final LMAccess.USER_INFO_1 userInfo = new LMAccess.USER_INFO_1();
-        userInfo.usri1_name = new WString(MockWindowsAccount.TEST_USER_NAME).toString();
-        userInfo.usri1_password = new WString(MockWindowsAccount.TEST_PASSWORD).toString();
+        userInfo.usri1_name = MockWindowsAccount.TEST_USER_NAME;
+        userInfo.usri1_password = MockWindowsAccount.TEST_PASSWORD;
         userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
         // ignore test if not able to add user (need to be administrator to do this).
         Assumptions.assumeTrue(LMErr.NERR_Success == Netapi32.INSTANCE.NetUserAdd(null, 1, userInfo, null));
diff --git a/Source/JNA/waffle-tests/src/test/java/waffle/servlet/ImpersonateTest.java b/Source/JNA/waffle-tests/src/test/java/waffle/servlet/ImpersonateTest.java
index 10c8d3b5a0..110e71b76d 100644
--- a/Source/JNA/waffle-tests/src/test/java/waffle/servlet/ImpersonateTest.java
+++ b/Source/JNA/waffle-tests/src/test/java/waffle/servlet/ImpersonateTest.java
@@ -23,7 +23,6 @@
  */
 package waffle.servlet;
 
-import com.sun.jna.WString;
 import com.sun.jna.platform.win32.Advapi32Util;
 import com.sun.jna.platform.win32.LMAccess;
 import com.sun.jna.platform.win32.LMErr;
@@ -77,8 +76,8 @@ void setUp() {
         }
 
         this.userInfo = new LMAccess.USER_INFO_1();
-        this.userInfo.usri1_name = new WString(MockWindowsAccount.TEST_USER_NAME).toString();
-        this.userInfo.usri1_password = new WString(MockWindowsAccount.TEST_PASSWORD).toString();
+        this.userInfo.usri1_name = MockWindowsAccount.TEST_USER_NAME;
+        this.userInfo.usri1_password = MockWindowsAccount.TEST_PASSWORD;
         this.userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
 
         this.resultOfNetAddUser = Netapi32.INSTANCE.NetUserAdd(null, 1, this.userInfo, null);
diff --git a/Source/JNA/waffle-tests/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java b/Source/JNA/waffle-tests/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
index 5dc97a318c..975f99922e 100644
--- a/Source/JNA/waffle-tests/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
+++ b/Source/JNA/waffle-tests/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
@@ -25,7 +25,6 @@
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import com.sun.jna.WString;
 import com.sun.jna.platform.win32.Advapi32Util;
 import com.sun.jna.platform.win32.LMAccess;
 import com.sun.jna.platform.win32.LMErr;
@@ -80,14 +79,14 @@ void testLogonGuestUser() {
     @Test
     void testLogonUser() {
         final LMAccess.USER_INFO_1 userInfo = new LMAccess.USER_INFO_1();
-        userInfo.usri1_name = new WString("WaffleTestUser").toString();
-        userInfo.usri1_password = new WString("!WAFFLEP$$Wrd0").toString();
+        userInfo.usri1_name = "WaffleTestUser";
+        userInfo.usri1_password = "!WAFFLEP$$Wrd0";
         userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
         // ignore test if not able to add user (need to be administrator to do this).
         Assumptions.assumeTrue(LMErr.NERR_Success == Netapi32.INSTANCE.NetUserAdd(null, 1, userInfo, null));
         try {
             final IWindowsAuthProvider prov = new WindowsAuthProviderImpl();
-            final IWindowsIdentity identity = prov.logonUser(userInfo.usri1_name, userInfo.usri1_password.toString());
+            final IWindowsIdentity identity = prov.logonUser(userInfo.usri1_name, userInfo.usri1_password);
             Assertions.assertTrue(identity.getFqn().endsWith("\\" + userInfo.usri1_name));
             Assertions.assertFalse(identity.isGuest());
             identity.dispose();
@@ -102,8 +101,8 @@ void testLogonUser() {
     @Test
     void testImpersonateLoggedOnUser() {
         final LMAccess.USER_INFO_1 userInfo = new LMAccess.USER_INFO_1();
-        userInfo.usri1_name = new WString(MockWindowsAccount.TEST_USER_NAME).toString();
-        userInfo.usri1_password = new WString(MockWindowsAccount.TEST_PASSWORD).toString();
+        userInfo.usri1_name = MockWindowsAccount.TEST_USER_NAME;
+        userInfo.usri1_password = MockWindowsAccount.TEST_PASSWORD;
         userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
         // ignore test if not able to add user (need to be administrator to do this).
         Assumptions.assumeTrue(LMErr.NERR_Success == Netapi32.INSTANCE.NetUserAdd(null, 1, userInfo, null));

From 3a874123b209ece2b497bd59fcacf06344cd0141 Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:46:14 -0500
Subject: [PATCH 05/13] [cleanup] Remove unnecessary boxing

---
 .../src/test/java/waffle/servlet/WindowsPrincipalTest.java      | 2 +-
 .../src/test/java/waffle/servlet/WindowsPrincipalTest.java      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WindowsPrincipalTest.java b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WindowsPrincipalTest.java
index 58f1f8f050..d56a022451 100644
--- a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WindowsPrincipalTest.java
+++ b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WindowsPrincipalTest.java
@@ -80,7 +80,7 @@ void testIsSerializable() throws IOException, ClassNotFoundException {
         Assertions.assertEquals(this.windowsPrincipal.getName(), copy.getName());
         Assertions.assertEquals(this.windowsPrincipal.getRolesString(), copy.getRolesString());
         Assertions.assertEquals(this.windowsPrincipal.getSidString(), copy.getSidString());
-        Assertions.assertTrue(Boolean.valueOf(Arrays.equals(this.windowsPrincipal.getSid(), copy.getSid())));
+        Assertions.assertTrue(Arrays.equals(this.windowsPrincipal.getSid(), copy.getSid()));
     }
 
     /**
diff --git a/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WindowsPrincipalTest.java b/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WindowsPrincipalTest.java
index 58f1f8f050..d56a022451 100644
--- a/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WindowsPrincipalTest.java
+++ b/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WindowsPrincipalTest.java
@@ -80,7 +80,7 @@ void testIsSerializable() throws IOException, ClassNotFoundException {
         Assertions.assertEquals(this.windowsPrincipal.getName(), copy.getName());
         Assertions.assertEquals(this.windowsPrincipal.getRolesString(), copy.getRolesString());
         Assertions.assertEquals(this.windowsPrincipal.getSidString(), copy.getSidString());
-        Assertions.assertTrue(Boolean.valueOf(Arrays.equals(this.windowsPrincipal.getSid(), copy.getSid())));
+        Assertions.assertTrue(Arrays.equals(this.windowsPrincipal.getSid(), copy.getSid()));
     }
 
     /**

From d717df36ae79f96e05e9aae4f5750494bfafd2cb Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:46:39 -0500
Subject: [PATCH 06/13] [secure] Make sure tests are not exposed to XXE

---
 .../src/test/java/waffle/servlet/WaffleInfoServletTest.java  | 3 +++
 .../src/test/java/waffle/servlet/WaffleInfoServletTest.java  | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WaffleInfoServletTest.java b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WaffleInfoServletTest.java
index 0aa580a8a3..acec99d5ac 100644
--- a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WaffleInfoServletTest.java
+++ b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/servlet/WaffleInfoServletTest.java
@@ -28,6 +28,7 @@
 import java.io.IOException;
 import java.io.StringReader;
 
+import javax.xml.XMLConstants;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -109,6 +110,8 @@ void testGetInfo() throws ParserConfigurationException, SAXException, IOExceptio
     private static Document loadXMLFromString(final String xml)
             throws ParserConfigurationException, SAXException, IOException {
         final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+        factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
         final DocumentBuilder builder = factory.newDocumentBuilder();
         final InputSource is = new InputSource(new StringReader(xml));
         return builder.parse(is);
diff --git a/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WaffleInfoServletTest.java b/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WaffleInfoServletTest.java
index 17a2ab0004..de62ddf67b 100644
--- a/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WaffleInfoServletTest.java
+++ b/Source/JNA/waffle-tests/src/test/java/waffle/servlet/WaffleInfoServletTest.java
@@ -1,7 +1,7 @@
 /*
  * MIT License
  *
- * Copyright (c) 2010-2022 The Waffle Project Contributors: https://github.com/Waffle/waffle/graphs/contributors
+ * Copyright (c) 2010-2024 The Waffle Project Contributors: https://github.com/Waffle/waffle/graphs/contributors
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -29,6 +29,7 @@
 import java.io.StringReader;
 
 import javax.servlet.ServletException;
+import javax.xml.XMLConstants;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -112,6 +113,8 @@ void testGetInfo() throws ParserConfigurationException, SAXException, IOExceptio
     private static Document loadXMLFromString(final String xml)
             throws ParserConfigurationException, SAXException, IOException {
         final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
+        factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
         final DocumentBuilder builder = factory.newDocumentBuilder();
         final InputSource is = new InputSource(new StringReader(xml));
         return builder.parse(is);

From 7cd0c2a296a1876b11e7a880db134353e43d289b Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:47:01 -0500
Subject: [PATCH 07/13] [cleanup] Fix order of equals check to avoid nulls

---
 .../src/main/java/waffle/mock/MockWindowsAuthProvider.java    | 4 ++--
 .../src/main/java/waffle/mock/MockWindowsAuthProvider.java    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/MockWindowsAuthProvider.java b/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/MockWindowsAuthProvider.java
index b973e250c1..ad495ceebc 100644
--- a/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/MockWindowsAuthProvider.java
+++ b/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/MockWindowsAuthProvider.java
@@ -106,9 +106,9 @@ public IWindowsIdentity logonDomainUserEx(final String username, final String do
     @Override
     public IWindowsIdentity logonUser(final String username, final String password) {
         final String currentUsername = Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible);
-        if (username.equals(currentUsername)) {
+        if (currentUsername.equals(username)) {
             return new MockWindowsIdentity(currentUsername, this.groups);
-        } else if (username.equals(MockWindowsAuthProvider.GUEST)) {
+        } else if (MockWindowsAuthProvider.GUEST.equals(username)) {
             return new MockWindowsIdentity(MockWindowsAuthProvider.GUEST, this.groups);
         } else {
             throw new RuntimeException("Mock error: " + username);
diff --git a/Source/JNA/waffle-tests/src/main/java/waffle/mock/MockWindowsAuthProvider.java b/Source/JNA/waffle-tests/src/main/java/waffle/mock/MockWindowsAuthProvider.java
index b973e250c1..ad495ceebc 100644
--- a/Source/JNA/waffle-tests/src/main/java/waffle/mock/MockWindowsAuthProvider.java
+++ b/Source/JNA/waffle-tests/src/main/java/waffle/mock/MockWindowsAuthProvider.java
@@ -106,9 +106,9 @@ public IWindowsIdentity logonDomainUserEx(final String username, final String do
     @Override
     public IWindowsIdentity logonUser(final String username, final String password) {
         final String currentUsername = Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible);
-        if (username.equals(currentUsername)) {
+        if (currentUsername.equals(username)) {
             return new MockWindowsIdentity(currentUsername, this.groups);
-        } else if (username.equals(MockWindowsAuthProvider.GUEST)) {
+        } else if (MockWindowsAuthProvider.GUEST.equals(username)) {
             return new MockWindowsIdentity(MockWindowsAuthProvider.GUEST, this.groups);
         } else {
             throw new RuntimeException("Mock error: " + username);

From f2c02cd3360b01e2f135f86a0a026781f92d7aa7 Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:47:46 -0500
Subject: [PATCH 08/13] [cleanup] Remove throws that never occur

---
 .../src/main/java/waffle/mock/http/SimpleHttpResponse.java      | 2 +-
 .../src/main/java/waffle/mock/http/SimpleHttpResponse.java      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/http/SimpleHttpResponse.java b/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/http/SimpleHttpResponse.java
index cae64c4699..3fc0e36bf4 100644
--- a/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/http/SimpleHttpResponse.java
+++ b/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/http/SimpleHttpResponse.java
@@ -62,7 +62,7 @@ public class SimpleHttpResponse extends HttpServletResponseWrapper {
     /** The out. */
     private final ServletOutputStream out = new ServletOutputStream() {
         @Override
-        public void write(final int b) throws IOException {
+        public void write(final int b) {
             SimpleHttpResponse.this.bytes.write(b);
         }
 
diff --git a/Source/JNA/waffle-tests/src/main/java/waffle/mock/http/SimpleHttpResponse.java b/Source/JNA/waffle-tests/src/main/java/waffle/mock/http/SimpleHttpResponse.java
index 1bdbf4a953..6991dc5be5 100644
--- a/Source/JNA/waffle-tests/src/main/java/waffle/mock/http/SimpleHttpResponse.java
+++ b/Source/JNA/waffle-tests/src/main/java/waffle/mock/http/SimpleHttpResponse.java
@@ -62,7 +62,7 @@ public class SimpleHttpResponse extends HttpServletResponseWrapper {
     /** The out. */
     private final ServletOutputStream out = new ServletOutputStream() {
         @Override
-        public void write(final int b) throws IOException {
+        public void write(final int b) {
             SimpleHttpResponse.this.bytes.write(b);
         }
 

From e00e8287bc0edda3eb5d165b0a33b38fd5a700c1 Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:48:05 -0500
Subject: [PATCH 09/13] [cleanup] Move getRoles from list to set

---
 .../src/main/java/waffle/servlet/WindowsPrincipal.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Source/JNA/waffle-jna/src/main/java/waffle/servlet/WindowsPrincipal.java b/Source/JNA/waffle-jna/src/main/java/waffle/servlet/WindowsPrincipal.java
index a0ffa847fc..a6fbc83969 100644
--- a/Source/JNA/waffle-jna/src/main/java/waffle/servlet/WindowsPrincipal.java
+++ b/Source/JNA/waffle-jna/src/main/java/waffle/servlet/WindowsPrincipal.java
@@ -27,8 +27,10 @@
 import java.security.Principal;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import waffle.windows.auth.IWindowsAccount;
 import waffle.windows.auth.IWindowsIdentity;
@@ -53,7 +55,7 @@ public class WindowsPrincipal implements Principal, Serializable {
     private final String sidString;
 
     /** The roles. */
-    private final List roles;
+    private final Set roles;
 
     /** The identity. */
     private transient IWindowsIdentity identity;
@@ -103,9 +105,9 @@ public WindowsPrincipal(final IWindowsIdentity windowsIdentity, final PrincipalF
      *
      * @return the roles
      */
-    private static List getRoles(final IWindowsIdentity windowsIdentity, final PrincipalFormat principalFormat,
+    private static Set getRoles(final IWindowsIdentity windowsIdentity, final PrincipalFormat principalFormat,
             final PrincipalFormat roleFormat) {
-        final List roles = new ArrayList<>();
+        final Set roles = new HashSet<>();
         roles.addAll(WindowsPrincipal.getPrincipalNames(windowsIdentity, principalFormat));
         for (final IWindowsAccount group : windowsIdentity.getGroups()) {
             roles.addAll(WindowsPrincipal.getRoleNames(group, roleFormat));

From e27b0b56ff53105f185b7c0bad086e2a01e4116d Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:48:14 -0500
Subject: [PATCH 10/13] [cleanup] Add missing finals

---
 .../src/main/java/waffle/util/cache/CaffeineCache.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Source/JNA/waffle-jna/src/main/java/waffle/util/cache/CaffeineCache.java b/Source/JNA/waffle-jna/src/main/java/waffle/util/cache/CaffeineCache.java
index cb950c488d..386e937348 100644
--- a/Source/JNA/waffle-jna/src/main/java/waffle/util/cache/CaffeineCache.java
+++ b/Source/JNA/waffle-jna/src/main/java/waffle/util/cache/CaffeineCache.java
@@ -53,17 +53,17 @@ public CaffeineCache(@NonNegative final long timeout) {
     }
 
     @Override
-    public V get(K key) {
+    public V get(final K key) {
         return cache.asMap().get(key);
     }
 
     @Override
-    public void put(K key, V value) {
+    public void put(final K key, final V value) {
         cache.put(key, value);
     }
 
     @Override
-    public void remove(K key) {
+    public void remove(final K key) {
         cache.asMap().remove(key);
     }
 

From 0752ebb4900d63e2540fed40c9b553ff446dea4d Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:48:44 -0500
Subject: [PATCH 11/13] [cleanup] Remove unnecessary use of regex in tests

---
 .../src/main/java/waffle/mock/http/SimpleHttpRequest.java       | 2 +-
 .../src/main/java/waffle/mock/http/SimpleHttpRequest.java       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/http/SimpleHttpRequest.java b/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/http/SimpleHttpRequest.java
index 5fcb529720..ec33075483 100644
--- a/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/http/SimpleHttpRequest.java
+++ b/Source/JNA/waffle-tests-jakarta/src/main/java/waffle/mock/http/SimpleHttpRequest.java
@@ -202,7 +202,7 @@ public String getQueryString() {
     public void setQueryString(final String query) {
         this.queryString = query;
         if (this.queryString != null) {
-            for (final String eachParameter : this.queryString.split("[&]", -1)) {
+            for (final String eachParameter : this.queryString.split("&", -1)) {
                 final String[] pair = eachParameter.split("=", -1);
                 final String value = pair.length == 2 ? pair[1] : "";
                 this.addParameter(pair[0], value);
diff --git a/Source/JNA/waffle-tests/src/main/java/waffle/mock/http/SimpleHttpRequest.java b/Source/JNA/waffle-tests/src/main/java/waffle/mock/http/SimpleHttpRequest.java
index a5aabaeb49..41bfc8cd4a 100644
--- a/Source/JNA/waffle-tests/src/main/java/waffle/mock/http/SimpleHttpRequest.java
+++ b/Source/JNA/waffle-tests/src/main/java/waffle/mock/http/SimpleHttpRequest.java
@@ -202,7 +202,7 @@ public String getQueryString() {
     public void setQueryString(final String query) {
         this.queryString = query;
         if (this.queryString != null) {
-            for (final String eachParameter : this.queryString.split("[&]", -1)) {
+            for (final String eachParameter : this.queryString.split("&", -1)) {
                 final String[] pair = eachParameter.split("=", -1);
                 final String value = pair.length == 2 ? pair[1] : "";
                 this.addParameter(pair[0], value);

From d66816caf4cfa0a7cdb3d4ad404c3462bd5c6b41 Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:49:03 -0500
Subject: [PATCH 12/13] [cleanup] Remove unnecessary toString()

---
 .../test/java/waffle/windows/auth/WindowsAuthProviderTest.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
index f7fb68a5b5..0162c3053b 100644
--- a/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
+++ b/Source/JNA/waffle-tests-jakarta/src/test/java/waffle/windows/auth/WindowsAuthProviderTest.java
@@ -86,7 +86,7 @@ void testLogonUser() {
         Assumptions.assumeTrue(LMErr.NERR_Success == Netapi32.INSTANCE.NetUserAdd(null, 1, userInfo, null));
         try {
             final IWindowsAuthProvider prov = new WindowsAuthProviderImpl();
-            final IWindowsIdentity identity = prov.logonUser(userInfo.usri1_name, userInfo.usri1_password.toString());
+            final IWindowsIdentity identity = prov.logonUser(userInfo.usri1_name, userInfo.usri1_password);
             Assertions.assertTrue(identity.getFqn().endsWith("\\" + userInfo.usri1_name));
             Assertions.assertFalse(identity.isGuest());
             identity.dispose();

From 04b9518e4c7f5e94fb9f61ac48728b641fa2f721 Mon Sep 17 00:00:00 2001
From: Jeremy Landis 
Date: Sun, 21 Jan 2024 19:49:10 -0500
Subject: [PATCH 13/13] [docs] Cleanup javadoc

---
 .../JNA/waffle-jna/src/main/java/waffle/util/NtlmMessage.java  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Source/JNA/waffle-jna/src/main/java/waffle/util/NtlmMessage.java b/Source/JNA/waffle-jna/src/main/java/waffle/util/NtlmMessage.java
index 8f43acafcd..03cfc6c055 100644
--- a/Source/JNA/waffle-jna/src/main/java/waffle/util/NtlmMessage.java
+++ b/Source/JNA/waffle-jna/src/main/java/waffle/util/NtlmMessage.java
@@ -28,8 +28,7 @@
  */
 public final class NtlmMessage {
 
-    // NTLM messages start with 0x4e544c4d53535000, NTLMSSP signature
-    /** The Constant NTLM_SSP_SIGNATURE. */
+    /** The Constant NTLM_SSP_SIGNATURE. NTLM messages start with 0x4e544c4d53535000, NTLMSSP signature */
     private static final byte[] NTLM_SSP_SIGNATURE = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00 };
 
     /**