From 0a5bd89129182ed03c6e912c8c078744e210e782 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:31:27 +0100 Subject: [PATCH] Align JettyByteBufferIterator implementations Both are now static nested classes. --- .../adapter/JettyWebSocketHandlerAdapter.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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() {