RFR 4358774: Add null InputStream and OutputStream
Sergey.Bylokhov at oracle.com
Thu Dec 7 23:14:25 UTC 2017
On 07/12/2017 14:55, Brian Burkhalter wrote:
> Hi Roger,
> I agree. It does not seem that whatever performance improvement might accrue from not using the Objects methods is offset by the increased code readability in addition to mitigating the risks mentioned in . I have reinstated this approach in http://cr.openjdk.java.net/~bpb/4358774/webrev.02/.
should be called before
Objects.checkFromIndexSize(off, len, b.length);
since the second call will gen NPW at b.length anyway?
> On Dec 7, 2017, at 2:04 PM, Roger Riggs <Roger.Riggs at Oracle.com> wrote:
>> For checking indices, I think you should leverage the work done for java.util.Objects.checkFromIndexSize(...)
>> as optimized for this purpose in 8135248. That was extensively designed and reviewed for optimal performance.
>> Regards, Roger
>>  https://bugs.openjdk.java.net/browse/JDK-8135248
Best regards, Sergey.
More information about the core-libs-dev