File apache-sshd-2.7.0-java8.patch of Package apache-sshd.28016
--- apache-sshd-2.7.0/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java 2021-07-30 09:48:59.082251041 +0200
+++ apache-sshd-2.7.0/sshd-core/src/main/java/org/apache/sshd/common/io/nio2/Nio2Session.java 2021-07-30 09:54:40.568508196 +0200
@@ -353,13 +353,13 @@
log.trace("handleReadCycleCompletion({}) read {} bytes after {} nanos at cycle={}",
this, result, System.nanoTime() - lastReadCycleStart.get(), readCyclesCounter);
}
- buffer.flip();
+ ((java.nio.Buffer)buffer).flip();
IoHandler handler = getIoHandler();
handler.messageReceived(this, bufReader);
if (!closeFuture.isClosed()) {
// re-use reference for next iteration since we finished processing it
- buffer.clear();
+ ((java.nio.Buffer)buffer).clear();
doReadCycle(buffer, completionHandler);
} else {
if (debugEnabled) {
--- apache-sshd-2.7.0/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java 2021-07-30 09:48:59.150251491 +0200
+++ apache-sshd-2.7.0/sshd-sftp/src/main/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannel.java 2021-07-30 09:54:40.572508221 +0200
@@ -21,6 +21,7 @@
import java.io.IOException;
import java.io.StreamCorruptedException;
+import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.AsynchronousCloseException;
@@ -153,7 +154,7 @@
if (read > 0) {
// reference equality on purpose
if (wrap == buffer) {
- wrap.position(wrap.position() + read);
+ ((Buffer)wrap).position(wrap.position() + read);
} else {
buffer.put(wrap.array(), wrap.arrayOffset(), read);
}
@@ -258,7 +259,7 @@
wrap.arrayOffset() + wrap.position(), written);
// reference equality on purpose
if (wrap == buffer) {
- wrap.position(wrap.position() + written);
+ ((Buffer)wrap).position(wrap.position() + written);
}
curPos += written;
totalWritten += written;
--- apache-sshd-2.7.0/sshd-sftp/src/main/java/org/apache/sshd/sftp/server/AbstractSftpSubsystemHelper.java 2021-07-30 09:48:59.150251491 +0200
+++ apache-sshd-2.7.0/sshd-sftp/src/main/java/org/apache/sshd/sftp/server/AbstractSftpSubsystemHelper.java 2021-07-30 09:55:19.804767492 +0200
@@ -942,7 +942,7 @@
if (remainLen < digestBuf.length) {
bb = ByteBuffer.wrap(digestBuf, 0, remainLen);
}
- bb.clear(); // prepare for next read
+ ((java.nio.Buffer)bb).clear(); // prepare for next read
int readLen = channel.read(bb);
if (readLen < 0) {
@@ -967,7 +967,7 @@
if (remainLen < digestBuf.length) {
bb = ByteBuffer.wrap(digestBuf, 0, remainLen);
}
- bb.clear(); // prepare for next read
+ ((java.nio.Buffer)bb).clear(); // prepare for next read
int readLen = channel.read(bb);
if (readLen < 0) {
@@ -1101,7 +1101,7 @@
if (remainLen < digestBuf.length) {
bb = ByteBuffer.wrap(digestBuf, 0, remainLen);
}
- bb.clear(); // prepare for next read
+ ((java.nio.Buffer)bb).clear(); // prepare for next read
int readLen = channel.read(bb);
if (readLen < 0) {