On Mon, 5 Sep 2022 18:05:04 GMT, Markus KARG <d...@openjdk.org> wrote:

>> Implementation of JDK-8279283
>
> Markus KARG has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   HexPrinter::transferTo

test/lib/jdk/test/lib/hexdump/HexPrinter.java line 1194:

> 1192:             byteOffset += size;
> 1193:             return size;
> 1194:         }

This is an indication that overriding `transferTo()` in `BufferedInputStream` 
has potential compatibility impacts on its subclasses. Therefore I would 
suggest adding a check in `BufferedInputStream::transferTo` to only override 
the behavior if not subclassed. Something like:


     if (this.getClass() != BufferedInputStream.class) {
         // a custom subclass may have expectations on which
         // methods tansferTo() will call. Revert to super class
         // behavior for compatibility.
         return super.transferTo(out);
     }
     ... otherwise proceed with the new implementation ...


Then you can revert the changes in this test.

-------------

PR: https://git.openjdk.org/jdk/pull/6935

Reply via email to