Skip to content

Commit c2249d3

Browse files
committed
Fix spotless violations
1 parent ac3afeb commit c2249d3

File tree

5 files changed

+44
-24
lines changed

5 files changed

+44
-24
lines changed

modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,11 @@ public TokenStream create(TokenStream tokenStream) {
330330
filters.put("uppercase", UpperCaseTokenFilterFactory::new);
331331
filters.put("word_delimiter_graph", WordDelimiterGraphTokenFilterFactory::new);
332332
filters.put("word_delimiter", WordDelimiterTokenFilterFactory::new);
333-
filters.put("stop_remote", requiresAnalysisSettings((i, e, n, s) -> new StopRemoteWordListTokenFilterFactory(
334-
i, e, n, s, wordListsIndexServiceHolder.get()))
333+
filters.put(
334+
"stop_remote",
335+
requiresAnalysisSettings(
336+
(i, e, n, s) -> new StopRemoteWordListTokenFilterFactory(i, e, n, s, wordListsIndexServiceHolder.get())
337+
)
335338
);
336339
return filters;
337340
}

server/src/main/java/org/elasticsearch/index/analysis/Analysis.java

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,8 @@ public void onResponse(String s) {
313313
try {
314314
s = readFile(pathAsUrl);
315315
} catch (IOException e) {
316-
listener.onFailure(new ElasticsearchStatusException(
317-
"Unable to read file at " + settingPath,
318-
RestStatus.BAD_REQUEST,
319-
e)
316+
listener.onFailure(
317+
new ElasticsearchStatusException("Unable to read file at " + settingPath, RestStatus.BAD_REQUEST, e)
320318
);
321319
return;
322320
}
@@ -331,32 +329,36 @@ public void onResponse(WordListsIndexService.PutWordListResult putWordListResult
331329
@Override
332330
public void onFailure(Exception e) {
333331
logger.warn("Unable to index word list [" + wordListPath + "] for index [" + indexName + "]", e);
334-
// listener.onFailure(new ElasticsearchStatusException(
335-
// "Unable to index word list [" + wordListPath + "] for index [" + indexName + "]",
336-
// RestStatus.INTERNAL_SERVER_ERROR,
337-
// e
338-
// ));
332+
// listener.onFailure(new ElasticsearchStatusException(
333+
// "Unable to index word list [" + wordListPath + "] for index [" + indexName + "]",
334+
// RestStatus.INTERNAL_SERVER_ERROR,
335+
// e
336+
// ));
339337
}
340338
});
341339
}
342340

343341
try {
344342
listener.onResponse(loadWordList(s, removeComments));
345343
} catch (IOException e) {
346-
listener.onFailure(new ElasticsearchStatusException(
347-
"Unable to parse word list [" + wordListPath + "] for index [" + indexName + "]",
348-
RestStatus.INTERNAL_SERVER_ERROR,
349-
e)
344+
listener.onFailure(
345+
new ElasticsearchStatusException(
346+
"Unable to parse word list [" + wordListPath + "] for index [" + indexName + "]",
347+
RestStatus.INTERNAL_SERVER_ERROR,
348+
e
349+
)
350350
);
351351
}
352352
}
353353

354354
@Override
355355
public void onFailure(Exception e) {
356-
listener.onFailure(new ElasticsearchStatusException(
357-
"Unable to get word list [" + wordListPath + "] for index [" + indexName + "]",
358-
RestStatus.INTERNAL_SERVER_ERROR,
359-
e)
356+
listener.onFailure(
357+
new ElasticsearchStatusException(
358+
"Unable to get word list [" + wordListPath + "] for index [" + indexName + "]",
359+
RestStatus.INTERNAL_SERVER_ERROR,
360+
e
361+
)
360362
);
361363
}
362364
});
@@ -590,7 +592,12 @@ private static Path downloadFile(URI uri) throws IOException, InterruptedExcepti
590592
SpecialPermission.check();
591593
HttpResponse<InputStream> httpResponse;
592594
try {
593-
httpResponse = AccessController.doPrivileged((PrivilegedExceptionAction<HttpResponse<InputStream>>) () -> httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofInputStream()));
595+
httpResponse = AccessController.doPrivileged(
596+
(PrivilegedExceptionAction<HttpResponse<InputStream>>) () -> httpClient.send(
597+
httpRequest,
598+
HttpResponse.BodyHandlers.ofInputStream()
599+
)
600+
);
594601
} catch (PrivilegedActionException e) {
595602
throw (IOException) e.getCause();
596603
}

server/src/main/java/org/elasticsearch/index/analysis/StopRemoteWordListFilter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ protected boolean accept() throws IOException {
3737
Exception asyncInitException = this.asyncInitException.get();
3838
if (stopWords == null) {
3939
throw asyncInitException != null
40-
? new ElasticsearchStatusException("Stop filter async initialization failed", RestStatus.INTERNAL_SERVER_ERROR, asyncInitException)
40+
? new ElasticsearchStatusException(
41+
"Stop filter async initialization failed",
42+
RestStatus.INTERNAL_SERVER_ERROR,
43+
asyncInitException
44+
)
4145
: new ElasticsearchStatusException("Stop filter not initialized yet", RestStatus.CONFLICT);
4246
}
4347

server/src/main/java/org/elasticsearch/index/analysis/WordListsIndexService.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,13 @@ private static <Request extends ActionRequest, Response extends ActionResponse>
290290
Request request,
291291
ActionListener<Response> listener
292292
) {
293-
executeAsyncWithOrigin(client.threadPool().getThreadContext(), client.threadPool().generic(), origin, request, listener, (r, l) -> client.execute(action, r, l));
293+
executeAsyncWithOrigin(
294+
client.threadPool().getThreadContext(),
295+
client.threadPool().generic(),
296+
origin,
297+
request,
298+
listener,
299+
(r, l) -> client.execute(action, r, l)
300+
);
294301
}
295302
}

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/user/InternalUsers.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ public class InternalUsers {
227227
UsernamesField.WORD_LISTS_ROLE_NAME,
228228
null,
229229
new RoleDescriptor.IndicesPrivileges[] {
230-
RoleDescriptor.IndicesPrivileges.builder().indices(".word_lists*").privileges("all").allowRestrictedIndices(true).build()
231-
},
230+
RoleDescriptor.IndicesPrivileges.builder().indices(".word_lists*").privileges("all").allowRestrictedIndices(true).build() },
232231
null,
233232
null,
234233
null,

0 commit comments

Comments
 (0)