cleanup code to get rid of warning
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 20 Aug 2015 17:34:57 +0000 (20:34 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Thu, 20 Aug 2015 17:34:57 +0000 (20:34 +0300)
platform/util/src/com/intellij/openapi/util/JDOMExternalizerUtil.java

index 99c1147980d4fa10d3b3e6c2998747b2af552d80..ec487af33b594441212e759cfc56e895f844a69a 100644 (file)
@@ -84,12 +84,9 @@ public class JDOMExternalizerUtil {
 
   @Nullable
   public static String getFirstChildValueAttribute(@NotNull Element parent, @NotNull String childTagName) {
-    List<Element> children = parent.getChildren(childTagName);
-    if (!children.isEmpty()) {
-      Element first = children.get(0);
-      if (first != null) {
-        return first.getAttributeValue(VALUE_ATTR_NAME);
-      }
+    Element first = parent.getChild(childTagName);
+    if (first != null) {
+      return first.getAttributeValue(VALUE_ATTR_NAME);
     }
     return null;
   }