diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/SimpleXPathParts.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/SimpleXPathParts.java index 1fcf04242d5..c06845a6e0e 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/SimpleXPathParts.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/SimpleXPathParts.java @@ -63,4 +63,9 @@ protected void handleAddAttribute(String attribute, String value) { static SimpleXPathParts getFrozenInstance(String xpath) { return new SimpleXPathParts(xpath); } + + @Override + public int size() { + return elements.size(); + } } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/SupplementalDataInfo.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/SupplementalDataInfo.java index be41ef23436..60d54dd7db3 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/SupplementalDataInfo.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/SupplementalDataInfo.java @@ -1372,7 +1372,7 @@ public void cleanup() { @Override public void handlePathValue(String path, String value) { try { - XPathParts parts = XPathParts.getFrozenInstance(path); + XPathValue parts = SimpleXPathParts.getFrozenInstance(path); String level0 = parts.getElement(0); String level1 = parts.size() < 2 ? null : parts.getElement(1); String level2 = parts.size() < 3 ? null : parts.getElement(2); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathParts.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathParts.java index 3f1b030e48f..0c7c65eb9cb 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathParts.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathParts.java @@ -381,7 +381,7 @@ public boolean containsAttributeValue(String attribute, String value) { return false; } - /** How many elements are in this xpath? */ + @Override public int size() { return elements.size(); } diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathValue.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathValue.java index 86882f133d2..03eca206cfe 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathValue.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathValue.java @@ -11,4 +11,7 @@ public interface XPathValue { * Returns null if there's nothing. */ String getAttributeValue(int i, String string); + + /** How many elements are in this xpath? */ + int size(); }