[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IO] Provenance of copied code in InfiniteCircularInputStream

Hi everybody,

the code is from a pull request which I merged:


I did not author the code.

The comment seems incorrect because I do not think there is a field "repeatedContent" in java.io.ByteArrayInputStream. The current OpenJDK implementation looks pretty different:



Am 19.11.2018 um 16:59 schrieb Gary Gregory:
Hi All and Pascal S.,

Sharon (Eclipse) has pointed out to me that in org.apache.commons.io.input.InfiniteCircularInputStream.read() [1], we have:

    public int read() {
        position = (position + 1) % repeatedContent.length;
        return repeatedContent[position] & 0xff; // copied from
 // java.io.ByteArrayInputStream.read()

Where does the code originate? Oracle JRE? OpenJDK? Where? Such a comment needs to show better provenance since I am pretty sure we are NOT allowed to copy code from Oracle.

The code was added with the commit


With this authorship:

@piotrturski <https://github.com/piotrturski>@PascalSchumacher <https://github.com/PascalSchumacher> piotrturski <https://github.com/apache/commons-io/commits?author=piotrturski> authored and PascalSchumacher <https://github.com/apache/commons-io/commits?author=PascalSchumacher> committed on Dec 1, 2015


[1] https://github.com/apache/commons-io/blob/3ad22fe3d689781a76a92908d0bbc119b2c68892/src/main/java/org/apache/commons/io/input/InfiniteCircularInputStream.java#L48-L49