Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unnecessary cast to "int" in SimpleStreamingClientHttpRequest [SPR-16404] #20950

spring-issuemaster opened this issue Jan 20, 2018 · 1 comment


None yet
2 participants
Copy link

commented Jan 20, 2018

Andrei Maus opened SPR-16404 and commented

ContentLength should not be casted to int in SimpleStreamingClientHttpRequest.getBodyInternal()

Since Java7 HttpURLConnection offers setFixedLengthStreamingMode method with long parameter which should be prefered over version with int argument, therefore casting ContentLength to int is no longer needed. Moreover it makes impossible to stream payload larger than Integer.MAX_VALUE

Affects: 5.0.2

Referenced from: pull request #1648


This comment has been minimized.

Copy link
Collaborator Author

commented Jan 20, 2018

Juergen Hoeller commented

Good catch! For consistency, I've also changed the analogous code in SimpleStreamingAsyncClientHttpRequest, despite its deprecation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.