import com.google.common.base.Preconditions;
import java.util.Collections;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
+import java.util.Map.Entry;
import javax.xml.transform.dom.DOMSource;
import org.opendaylight.controller.config.util.xml.DocumentedException;
import org.opendaylight.controller.config.util.xml.XmlElement;
final YangInstanceIdentifier.NodeIdentifierWithPredicates keyedId =
(YangInstanceIdentifier.NodeIdentifierWithPredicates) lastPathArgument;
final Map<QName, Object> keyValues = keyedId.getKeyValues();
- for (QName qualifiedName : keyValues.keySet()) {
+ for (Entry<QName, Object> entry : keyValues.entrySet()) {
+ QName qualifiedName = entry.getKey();
final List<XmlElement> key =
dataElement.getChildElementsWithinNamespace(qualifiedName.getLocalName(),
qualifiedName.getNamespace().toString());
} catch (DocumentedException e) {
throw new IllegalStateException("Key value not present in key element", e);
}
- if (!keyValues.get(qualifiedName).equals(textContent)) {
+ if (!entry.getValue().equals(textContent)) {
throw new IllegalStateException("Key value in path not equal to key value in xml");
}
}
}
private static String toOperationString(final ModifyAction operation) {
- return operation.name().toLowerCase();
+ return operation.name().toLowerCase(Locale.ROOT);
}
private static Element getSourceElement(final DOMSource source) {