Remove unnecessary calls to Path#toString
This commit removes some unnecessary calls to Path#toString when logging a path in OperationFileModeWatcher#onChage. The calls to Path#toString are not necessary since the logging infrastructure will do this anyway. Original commit: elastic/x-pack-elasticsearch@da1bc30d60
This commit is contained in:
parent
4cd3e02206
commit
b1f97ea5ed
|
@ -99,9 +99,7 @@ public final class OperationModeFileWatcher implements FileChangesListener {
|
|||
} catch (IOException e) {
|
||||
logger.error(
|
||||
(Supplier<?>) () -> new ParameterizedMessage(
|
||||
"couldn't read operation mode from [{}]",
|
||||
licenseModePath.toAbsolutePath().toString()),
|
||||
e);
|
||||
"couldn't read operation mode from [{}]", licenseModePath.toAbsolutePath()), e);
|
||||
return;
|
||||
}
|
||||
String operationMode = new String(content, StandardCharsets.UTF_8);
|
||||
|
@ -109,11 +107,8 @@ public final class OperationModeFileWatcher implements FileChangesListener {
|
|||
currentOperationMode = OperationMode.resolve(operationMode);
|
||||
} catch (IllegalArgumentException e) {
|
||||
logger.error(
|
||||
(Supplier<?>)
|
||||
() -> new ParameterizedMessage(
|
||||
"invalid operation mode in [{}]",
|
||||
licenseModePath.toAbsolutePath().toString()),
|
||||
e);
|
||||
(Supplier<?>) () -> new ParameterizedMessage(
|
||||
"invalid operation mode in [{}]", licenseModePath.toAbsolutePath()), e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue