Uh oh!
There was an error while loading. Please reload this page.
fix: usage of Optional.orElseThrow after Map.put - #2145
Conversation
| import java.util.Collections; | ||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import java.util.Optional; |
There was a problem hiding this comment.
there is no need for this import
| */ | ||
| public Map<String, Object> build() { | ||
| var map = new HashMap<String, Object>(); | ||
| ofNullable(this.keyCode).map(x -> map.put("keycode", x)).orElseThrow(() -> new IllegalStateException( |
There was a problem hiding this comment.
@valfirst Could there be other places in the source like this one? I assume the issue may have been added during the recent refactoring
There was a problem hiding this comment.
yes, this is a regression issue, I've found 2 more similar occurrences, I'll open PR soon
There was a problem hiding this comment.
thanks. Lets address them all and publish a patch asap
There was a problem hiding this comment.
@mykola-mokhnach I believe I fixed them in my last commit
There was a problem hiding this comment.
I've already addressed AndroidGeoLocation issues here: #2146
valfirst
commented
Mar 28, 2024
@artlomako checkstyle is failed |
Change list
KeyEventTypes of changes
What types of changes are you proposing/introducing to Java client?
Put an
xin the boxes that applyDetails
After the last change in
KeyEventclass, it's impossible to use the key event, because the following code always throws an exception:since
map.put()returns null for new key.