String.replaceAll() performs an implicit compilation -- use a
pre-compiled pattern instead.
Change-Id: I5323d19d8b6c009d837a14e32d91ba711cd4d486
Signed-off-by: Robert Varga <rovarga@cisco.com>
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
+import java.util.regex.Pattern;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.yangtools.yang.common.QName;
}
}
+ private static final Pattern STRIP_PATTERN = Pattern.compile("\\[.*\\]");
+
/**
* Removes conditions from xPath pointed to target node.
*
*
*/
private static String stripConditionsFromXPathString(final RevisionAwareXPath pathStatement) {
- return pathStatement.toString().replaceAll("\\[.*\\]", "");
+ return STRIP_PATTERN.matcher(pathStatement.toString()).replaceAll("");
}
/**