RFR: 8284930: Re-examine FilterInputStream mark/reset

Daniel Fuchs dfuchs at openjdk.java.net
Wed Apr 20 13:36:38 UTC 2022


On Wed, 20 Apr 2022 11:56:20 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> As for the changes to `FilterInputStream`, would this change require a CSR?

There might be a case where a subclass of `FilterInputStream` has overridden all other methods to add `synchronized` but has not overridden `mark` and `reset`, relying on the synchronization of the super class. I have skimmed over subclasses in the JDK, and have found no evidence of such behavior (though I have not looked exhaustively at all subclasses). Of course such subclasses could exist in the wild, but that would be both odd and fragile, since synchronization is not specified. In this particular case I don't believe that we would need a CSR to remove a synchronized keyword: whether a method is synchronized or not is not documented and not part of the spec: https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/io/FilterInputStream.html#mark(int) - and `FilterInputStream` says nothing about synchronization.

I agree with Alan that `InputStream` should be modified similarly.

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

PR: https://git.openjdk.java.net/jdk/pull/8309


More information about the core-libs-dev mailing list