mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
fixed NPE - java.lang.NullPointerException
at net.openhft.chronicle.map.StatelessChronicleMap.receiveBytesFromSocket(StatelessChronicleMap.java:1322)
at net.openhft.chronicle.map.StatelessChronicleMap.nextEntry(StatelessChronicleMap.java:1216)
at net.openhft.chronicle.map.StatelessChronicleMap.blockingFetchThrowable(StatelessChronicleMap.java:1162)
at net.openhft.chronicle.map.StatelessChronicleMap.blockingFetchReadOnly(StatelessChronicleMap.java:1135)
at net.openhft.chronicle.map.StatelessChronicleMap.readValue(StatelessChronicleMap.java:1484)
at net.openhft.chronicle.map.StatelessChronicleMap.fetchObject(StatelessChronicleMap.java:1782)
at net.openhft.chronicle.map.StatelessChronicleMap.put(StatelessChronicleMap.java:596)
at net.openhft.chronicle.map.StatelessClientTest$3.run(StatelessClientTest.java:659)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
This commit is contained in:
@@ -1328,6 +1328,7 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
@SuppressWarnings("UnusedReturnValue")
|
||||
private Bytes receiveBytesFromSocket(int requiredNumberOfBytes, long timeoutTime) throws IOException {
|
||||
|
||||
|
||||
// assert !outBytesLock.isHeldByCurrentThread();
|
||||
assert inBytesLock.isHeldByCurrentThread();
|
||||
|
||||
@@ -1335,11 +1336,14 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
inBytes.limit(requiredNumberOfBytes);
|
||||
inBytes.buffer().position(0);
|
||||
inBytes.buffer().limit(requiredNumberOfBytes);
|
||||
SocketChannel clientChannel0 = clientChannel;
|
||||
if (clientChannel0 == null)
|
||||
return inBytes;
|
||||
|
||||
while (inBytes.buffer().remaining() > 0) {
|
||||
assert requiredNumberOfBytes <= inBytes.capacity();
|
||||
|
||||
int len = clientChannel.read(inBytes.buffer());
|
||||
int len = clientChannel0.read(inBytes.buffer());
|
||||
|
||||
if (len == -1)
|
||||
throw new IORuntimeException("Disconnection to server");
|
||||
|
||||
Reference in New Issue
Block a user