Skip to content

Commit

Permalink
Fix eclipse compilation (backport of #66047) (#66052)
Browse files Browse the repository at this point in the history
Looks like we've hit another "funny" eclipse compiler error. I filed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=569557 , but short version
is that the following code compiles with javac and not eclipse:
```
package test;

import java.util.function.Supplier;

public class Test {
	private final Object o = new Object();

	private class Inner {
		public Inner() {
			this(() -> o);
		}

		private Inner(Supplier<Object> o) {}
	}
}
```

Specifically the outer class's `o` can't be refered to in the lambda.
This stops us from doing that in ML so eclipse can be happy again.
  • Loading branch information
nik9000 authored Dec 8, 2020
1 parent e6bdfe4 commit 69198ec
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public SearchResponse searchWithRetry(SearchRequest searchRequest,
SearchRetryableAction mlRetryableAction = new SearchRetryableAction(
jobId,
searchRequest,
client,
shouldRetry,
retryMsgHandler,
getResponse);
Expand Down Expand Up @@ -273,6 +274,8 @@ private class SearchRetryableAction extends MlRetryableAction<SearchRequest, Sea
private final SearchRequest searchRequest;
SearchRetryableAction(String jobId,
SearchRequest searchRequest,
// Pass the client to work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=569557
OriginSettingClient client,
Supplier<Boolean> shouldRetry,
Consumer<String> msgHandler,
ActionListener<SearchResponse> listener) {
Expand Down

0 comments on commit 69198ec

Please sign in to comment.