Skip to content

@Contract for StreamUtils.drain() incorrectly declares null results in an exception #34933

Closed
@sbrannen

Description

@sbrannen

Overview

Although the implementation of org.springframework.util.StreamUtils.drain(InputStream) originally threw an IllegalArgumentException for a null InputStream, since commit 0b9b9b4 drain() returns 0 for a null stream.

Consequently, the @Contract("null -> fail") declaration is incorrect.

Related Issues

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions