Buggy code:
public void checkLimit ( final int limit ) { } public ByteBuffer duplicateByteBuffer ( ) { } public long getLong ( final int index , final ByteOrder byteOrder ) { } public void putLong ( final int index , final long value , final ByteOrder byteOrder ) { } public long getLong ( final int index ) { } public void putLong ( final int index , final long value ) { } public long getLongVolatile ( final int index ) { } public void putLongVolatile ( final int index , final long value ) { } public void putLongOrdered ( final int index , final long value ) { } public void addLongOrdered ( final int index , final long increment ) { } public boolean compareAndSetLong ( final int index , final long expectedValue , final long updateValue ) { } public long getAndSetLong ( final int index , final long value ) { } public long getAndAddLong ( final int index , final long delta ) { } public int getInt ( final int index , final ByteOrder byteOrder ) { } public void putInt ( final int index , final int value , final ByteOrder byteOrder ) { } public int getInt ( final int index ) { } public void putInt ( final int index , final int value ) { } public int getIntVolatile ( final int index ) { } public void putIntVolatile ( final int index , final int value ) { } public void putIntOrdered ( final int index , final int value ) { } public void addIntOrdered ( final int index , final int increment ) { } public boolean compareAndSetInt ( final int index , final int expectedValue , final int updateValue ) { } public int getAndSetInt ( final int index , final int value ) { } public int getAndAddInt ( final int index , final int delta ) { } public double getDouble ( final int index , final ByteOrder byteOrder ) { } public void putDouble ( final int index , final double value , final ByteOrder byteOrder ) { } public double getDouble ( final int index ) { } public void putDouble ( final int index , final double value ) { } public float getFloat ( final int index , final ByteOrder byteOrder ) { } public void putFloat ( final int index , final float value , final ByteOrder byteOrder ) { } public float getFloat ( final int index ) { } public void putFloat ( final int index , final float value ) { } public short getShort ( final int index , final ByteOrder byteOrder ) { } public void putShort ( final int index , final short value , final ByteOrder byteOrder ) { } public short getShort ( final int index ) { } public void putShort ( final int index , final short value ) { } public short getShortVolatile ( final int index ) { } public void putShortVolatile ( final int index , final short value ) { } public byte getByte ( final int index ) { } public void putByte ( final int index , final byte value ) { } public void getBytes ( final int index , final byte [ ] dst ) { } public void getBytes ( final int index , final byte [ ] dst , final int offset , final int length ) { } public void getBytes ( final int index , final MutableDirectBuffer dstBuffer , final int dstIndex , final int length ) { } public void getBytes ( final int index , final ByteBuffer dstBuffer , final int length ) { } public void putBytes ( final int index , final byte [ ] src ) { } public void putBytes ( final int index , final byte [ ] src , final int offset , final int length ) { } public void putBytes ( final int index , final ByteBuffer srcBuffer , final int length ) { } public void putBytes ( final int index , final ByteBuffer srcBuffer , final int srcIndex , final int length ) { boundsCheck ( index , length ) ; UnsafeBuffer . boundsCheck ( srcBuffer , srcIndex , length ) ; final byte [ ] srcByteArray ; final long srcBaseOffset ; if ( srcBuffer . hasArray ( ) ) { srcByteArray = srcBuffer . array ( ) ; <START_BUG> srcBaseOffset = ( ( UnsafeBuffer . ARRAY_BASE_OFFSET ) + ( srcBuffer . arrayOffset ( ) ) ) + srcIndex ; <END_BUG> } else { srcByteArray = null ; srcBaseOffset = ( ( sun . nio . ch . DirectBuffer ) ( srcBuffer ) ) . address ( ) ; } UnsafeBuffer . UNSAFE . copyMemory ( srcByteArray , ( srcBaseOffset + srcIndex ) , byteArray , ( ( addressOffset ) + index ) , length ) ; } public void putBytes ( final int index , final DirectBuffer srcBuffer , final int srcIndex , final int length ) { } public String getStringUtf8 ( final int offset , final ByteOrder byteOrder ) { } public String getStringUtf8 ( final int offset , final int length ) { } public int putStringUtf8 ( final int offset , final String value , final ByteOrder byteOrder ) { } public int putStringUtf8 ( final int offset , final String value , final ByteOrder byteOrder , final int maxEncodedSize ) { } public String getStringWithoutLengthUtf8 ( final int offset , final int length ) { } public int putStringWithoutLengthUtf8 ( final int offset , final String value ) { } public void boundsCheck ( final int index , final int length ) { } private static void boundsCheck ( final byte [ ] buffer , final int index , final int length ) { } private static void boundsCheck ( final ByteBuffer buffer , final int index , final int length ) { } }

Fix:
srcBaseOffset = ( UnsafeBuffer . ARRAY_BASE_OFFSET ) + ( srcBuffer . arrayOffset ( ) ) ;