Skip to content

Commit 1345a05

Browse files
committed
Fix Java 8 compatibility
1 parent 2145444 commit 1345a05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/RestHighLevelClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ void runIfNotCancelled(Runnable runnable) {
20432043
versionCheck.addListener(new ActionListener<Optional<String>>() {
20442044
@Override
20452045
public void onResponse(Optional<String> validation) {
2046-
if (validation.isEmpty()) {
2046+
if (validation.isPresent() == false) {
20472047
// Send the request and propagate cancellation
20482048
Cancellable call = client.performRequestAsync(request, listener);
20492049
cancellationForwarder.whenComplete((r, t) ->
@@ -2078,7 +2078,7 @@ private Response performClientRequest(Request request) throws IOException {
20782078
throw new ElasticsearchException(e);
20792079
}
20802080

2081-
if (versionValidation.isEmpty()) {
2081+
if (versionValidation.isPresent() == false) {
20822082
return client.performRequest(request);
20832083
} else {
20842084
throw new ElasticsearchException(versionValidation.get());

0 commit comments

Comments
 (0)