Skip to content

Rename replace() to replaceWith() since Java 1.8 introduces Map.replace() #670

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

Closed

Conversation

gerdriesselmann
Copy link
Contributor

Java 1.8 brings Map[K, V].replace(), declared as V replace(K key, V value).

This collides with replace declared on FluentCaseInsensitiveStringsMap and FluentStringsMap, which return the self type.

I therefore renamed the functions to replaceWith().

Alternative would be to change signature to return V and override Map's replace(), which however should not work on Java 6 and 7, I guess.

@slandelle
Copy link
Contributor

@gerdriesselmann Could you please squash your 3 commits into a single one?

@gerdriesselmann
Copy link
Contributor Author

I tried, but did succeed only partially, as there are now two more commits : D

However, this one contains all fixes in one commit: gerdriesselmann@f5736c1

Its the one labeled "Java 8 Compatibility Fixes"

@slandelle
Copy link
Contributor

Ha ha ha ha.
I'll cherry pick, then.

@slandelle slandelle added Defect and removed Defect labels Sep 2, 2014
@slandelle slandelle added this to the 1.9.0 milestone Sep 2, 2014
@slandelle slandelle self-assigned this Sep 2, 2014
@slandelle
Copy link
Contributor

closed by 8f53b1f

@slandelle slandelle closed this Sep 2, 2014
@slandelle
Copy link
Contributor

ported on master in b8e0c46

@slandelle
Copy link
Contributor

Thanks @gerdriesselmann

cs-workco pushed a commit to cs-workco/async-http-client that referenced this pull request Apr 13, 2023
* Fix crash if connection is closed very early

If the channel is closed before flatMap is executed, all ChannelHandler are removed and `TLSEventsHandler` is therefore not present either. We need to tolerate this even though it is very rare.

Testing ideas welcome.

Fixes AsyncHttpClient#670

* drop precondition to assert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants