diff --git a/d2/src/main/java/com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java b/d2/src/main/java/com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java index 4647f3c27c..2bba859484 100644 --- a/d2/src/main/java/com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java +++ b/d2/src/main/java/com/linkedin/d2/xds/XdsToD2PropertiesAdaptor.java @@ -354,15 +354,7 @@ private String getSymlink(String actualNodeName) { private static String getNodeName(String path) { - int idx = path.lastIndexOf(PATH_SEPARATOR); - if (idx == -1) - { - return path; - } - else - { - return path.substring(idx + 1); - } + return path.substring(path.lastIndexOf(PATH_SEPARATOR) + 1); } private void notifyAvailabilityChanges(boolean isAvailable)