Index: broadcast/InMemoryBroadcaster.java =================================================================== --- broadcast/InMemoryBroadcaster.java (revision 1865629) +++ broadcast/InMemoryBroadcaster.java (working copy) @@ -16,6 +16,7 @@ */ package org.apache.jackrabbit.oak.plugins.document.persistentCache.broadcast; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -32,7 +33,7 @@ public void send(ByteBuffer buff) { int start = buff.position(); for (Listener l : listeners) { - buff.position(start); + ((Buffer)buff).position(start); l.receive(buff); } } Index: broadcast/TCPBroadcaster.java =================================================================== --- broadcast/TCPBroadcaster.java (revision 1865629) +++ broadcast/TCPBroadcaster.java (working copy) @@ -26,6 +26,7 @@ import java.net.Socket; import java.net.SocketTimeoutException; import java.net.UnknownHostException; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.security.MessageDigest; @@ -223,7 +224,7 @@ ByteBuffer buff = ByteBuffer.wrap(data); int start = buff.position(); for (Listener l : listeners) { - buff.position(start); + ((Buffer)buff).position(start); l.receive(buff); } } @@ -324,7 +325,7 @@ public void send(ByteBuffer buff) { ByteBuffer b = ByteBuffer.allocate(buff.remaining()); b.put(buff); - b.flip(); + ((Buffer)b).flip(); while (sendBuffer.size() > MAX_BUFFER_SIZE) { sendBuffer.poll(); } Index: broadcast/UDPBroadcaster.java =================================================================== --- broadcast/UDPBroadcaster.java (revision 1865629) +++ broadcast/UDPBroadcaster.java (working copy) @@ -22,6 +22,7 @@ import java.net.DatagramPacket; import java.net.InetAddress; import java.net.MulticastSocket; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.security.MessageDigest; import java.util.ArrayList; @@ -132,10 +133,10 @@ continue; } ByteBuffer buff = ByteBuffer.wrap(receiveData); - buff.limit(len); + ((Buffer)buff).limit(len); int start = key.length; for (Listener l : listeners) { - buff.position(start); + ((Buffer)buff).position(start); l.receive(buff); } } catch (IOException e) { Index: PersistentCache.java =================================================================== --- PersistentCache.java (revision 1865629) +++ PersistentCache.java (working copy) @@ -17,6 +17,7 @@ package org.apache.jackrabbit.oak.plugins.document.persistentCache; import java.io.File; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.HashMap; @@ -524,10 +525,10 @@ writer.apply(buff); ByteBuffer byteBuff = buff.getBuffer(); int length = byteBuff.position(); - byteBuff.limit(length); + ((Buffer)byteBuff).limit(length); // write length byteBuff.putInt(0, length); - byteBuff.position(0); + ((Buffer)byteBuff).position(0); b.send(byteBuff); } @@ -540,7 +541,7 @@ // process only messages from other senders receiveMessage(buff); } - buff.position(end); + ((Buffer)buff).position(end); } public static PersistentCacheStats getPersistentCacheStats(Cache cache) {