This commit is contained in:
ReaJason
2026-01-18 23:49:41 +08:00
parent e9d60152b1
commit 0279d6cc0b
@@ -121,10 +121,10 @@ public class JettyFilterInjector {
Object[] mappings = (Object[]) invokeMethod(servletHandler, "getFilterMappings"); Object[] mappings = (Object[]) invokeMethod(servletHandler, "getFilterMappings");
Object[] newMappings = null; Object[] newMappings = null;
int length = Array.getLength(mappings); if (mappings == null || Array.getLength(mappings) == 0) {
if (mappings == null || length == 0) {
newMappings = (Object[]) Array.newInstance(filterMappingClass, 1); newMappings = (Object[]) Array.newInstance(filterMappingClass, 1);
} else { } else {
int length = Array.getLength(mappings);
newMappings = (Object[]) Array.newInstance(filterMappingClass, length + 1); newMappings = (Object[]) Array.newInstance(filterMappingClass, length + 1);
System.arraycopy(mappings, 0, newMappings, 1, length); System.arraycopy(mappings, 0, newMappings, 1, length);
} }