Implementing https://bugs.openjdk.java.net/browse/JDK-5071718

Sven Reimers sven.reimers at gmail.com
Sat Sep 26 16:41:51 UTC 2015


Hi all,

what would it take to get JDK-5071718 into 9?

I thought about something like this;

/**
 Creates a new byte buffer whose content is a shared subsequence of this
buffer's content.

The content of the new buffer will start at the given position. The
capacity and limit of the new buffer will be the given length. Changes to
this buffer's content will be visible in the new buffer, and vice versa;
the two buffers' position, limit, and mark values will be independent.

The new buffer's position will be zero, and its mark will be undefined. The
new buffer will be direct if, and only if, this buffer is direct, and it
will be read-only if, and only if, this buffer is read-only.
Returns:The new byte buffer
 **/
public abstract ByteBuffer slice(int start, int length)


Probably should emit some exception in case start or start+length are
greater than the underlying buffer length. Any further ideas for required
checks?

Seems I need to modify the templates to get this distributed to all the
variants existing - not only ByteBuffer.

Anyone able to guide me and help me get this through - I am willing to
provide implementation and tests if I know where to look for obstacles and
challenges?

Thanks

Sven
-- 
Sven Reimers

* Senior Expert Software Architect
* Java Champion
* NetBeans Dream Team Member: http://dreamteam.netbeans.org
* Community Leader  NetBeans: http://community.java.net/netbeans
                              Desktop Java:
http://community.java.net/javadesktop
* JUG Leader JUG Bodensee: http://www.jug-bodensee.de
* Duke's Choice Award Winner 2009
* Blog: https://www.java.net//blog/sven



More information about the core-libs-dev mailing list