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:
Jason Tedor 2016-08-30 21:06:41 -04:00
parent 4cd3e02206
commit b1f97ea5ed
1 changed files with 3 additions and 8 deletions

View File

@ -99,9 +99,7 @@ public final class OperationModeFileWatcher implements FileChangesListener {
} catch (IOException e) { } catch (IOException e) {
logger.error( logger.error(
(Supplier<?>) () -> new ParameterizedMessage( (Supplier<?>) () -> new ParameterizedMessage(
"couldn't read operation mode from [{}]", "couldn't read operation mode from [{}]", licenseModePath.toAbsolutePath()), e);
licenseModePath.toAbsolutePath().toString()),
e);
return; return;
} }
String operationMode = new String(content, StandardCharsets.UTF_8); String operationMode = new String(content, StandardCharsets.UTF_8);
@ -109,11 +107,8 @@ public final class OperationModeFileWatcher implements FileChangesListener {
currentOperationMode = OperationMode.resolve(operationMode); currentOperationMode = OperationMode.resolve(operationMode);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
logger.error( logger.error(
(Supplier<?>) (Supplier<?>) () -> new ParameterizedMessage(
() -> new ParameterizedMessage( "invalid operation mode in [{}]", licenseModePath.toAbsolutePath()), e);
"invalid operation mode in [{}]",
licenseModePath.toAbsolutePath().toString()),
e);
return; return;
} }
} }