Remove JDK 9 workarounds etc
See gh-17778
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 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.
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.messaging.simp.stomp;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
@@ -134,11 +133,7 @@ public class StompDecoder {
|
||||
private Message<byte[]> decodeMessage(ByteBuffer byteBuffer, @Nullable MultiValueMap<String, String> headers) {
|
||||
Message<byte[]> decodedMessage = null;
|
||||
skipEol(byteBuffer);
|
||||
|
||||
// Explicit mark/reset access via Buffer base type for compatibility
|
||||
// with covariant return type on JDK 9's ByteBuffer...
|
||||
Buffer buffer = byteBuffer;
|
||||
buffer.mark();
|
||||
byteBuffer.mark();
|
||||
|
||||
String command = readCommand(byteBuffer);
|
||||
if (command.length() > 0) {
|
||||
@@ -176,7 +171,7 @@ public class StompDecoder {
|
||||
headers.putAll(map);
|
||||
}
|
||||
}
|
||||
buffer.reset();
|
||||
byteBuffer.reset();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -357,8 +352,7 @@ public class StompDecoder {
|
||||
throw new StompConversionException("'\\r' must be followed by '\\n'");
|
||||
}
|
||||
}
|
||||
// Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer
|
||||
((Buffer) byteBuffer).position(byteBuffer.position() - 1);
|
||||
byteBuffer.position(byteBuffer.position() - 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user