diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java index 71c0a2c840c1..5e4b08d455ae 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -322,7 +322,16 @@ public String toString(int index, int length, Charset charset) { } - private record JettyByteBufferIterator(ByteBufferIterator delegate) implements ByteBufferIterator { + private static class JettyByteBufferIterator implements ByteBufferIterator { + + private final ByteBufferIterator delegate; + + + JettyByteBufferIterator(ByteBufferIterator delegate) { + Assert.notNull(delegate, "Delegate must not be null"); + + this.delegate = delegate; + } @Override public void close() {