Hi Peter, Buffer is not currently a generic class and making it so likely would cause some source compatibility issues (e.g. lots of raw type warnings/errors).
Paul. > On Jun 12, 2018, at 3:20 AM, Peter Levart <[email protected]> wrote: > > Hi, > > On 06/12/2018 11:34 AM, Vivek Theeyarath wrote: >> Hi All, >> >> Please review fix for >> https://bugs.openjdk.java.net/browse/JDK-8202216 >> >> >> Webrev: http://cr.openjdk.java.net/~vtheeyarath/8202216/webrev.00/ >> >> CSR : https://bugs.openjdk.java.net/browse/JDK-8204852 >> >> >> Regards >> >> Vivek >> >> > > This looks good as is, but would it make sense for this new method to be > defined as abstract method on Buffer? Like for example: > > public abstract class Buffer<B extends Buffer> { > public abstract int mismatch(B that); > ... > > > public abstract class ByteBuffer > extends Buffer<ByteBuffer> > implements Comparable<ByteBuffer> > { > @Override > public int mismatch(ByteBuffer that) { > ... > > > public abstract class CharBuffer > extends Buffer<CharBuffer> > implements Comparable<CharBuffer> > { > @Override > public int mismatch(CharBuffer that) { > ... > > > > Regards, Peter >
