Modernize collection allocation
[netconf.git] / netconf / netconf-api / src / main / java / org / opendaylight / netconf / api / xml / XmlElement.java
index 9b0f5e3af7293d03fe752197e112be0a3155bfab..c04fda11ac240f862a82c09cb43e2de3e552a69e 100644 (file)
@@ -5,15 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.api.xml;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Strings;
 import com.google.common.collect.Collections2;
 import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
 import java.io.IOException;
+import java.util.AbstractMap.SimpleImmutableEntry;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -170,7 +169,7 @@ public final class XmlElement {
 
     public Map<String, Attr> getAttributes() {
 
-        Map<String, Attr> mappedAttributes = Maps.newHashMap();
+        Map<String, Attr> mappedAttributes = new HashMap<>();
 
         NamedNodeMap attributes = element.getAttributes();
         for (int i = 0; i < attributes.getLength(); i++) {
@@ -446,7 +445,7 @@ public final class XmlElement {
             throw new IllegalArgumentException("Cannot find namespace for " + XmlUtil.toString(element)
                 + ". Prefix from content is " + prefix + ". Found namespaces " + namespaces);
         }
-        return Maps.immutableEntry(prefix, namespaces.get(prefix));
+        return new SimpleImmutableEntry<>(prefix, namespaces.get(prefix));
     }
 
     public List<XmlElement> getChildElementsWithSameNamespace(final String childName) throws MissingNameSpaceException {