This commit is contained in:
Vladimir Krivosheev
2016-11-02 11:41:28 +01:00
parent 0b1fa887da
commit 476a7f3ce8
4 changed files with 13 additions and 17 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -869,12 +869,11 @@ public class ApplicationInfoImpl extends ApplicationInfoEx {
}
myPluginChooserPages = new ArrayList<PluginChooserPage>();
final List children = parentNode.getChildren(PLUGINS_PAGE_ELEMENT_NAME);
for(Object child: children) {
myPluginChooserPages.add(new PluginChooserPageImpl((Element) child));
for (Element child : parentNode.getChildren(PLUGINS_PAGE_ELEMENT_NAME)) {
myPluginChooserPages.add(new PluginChooserPageImpl(child));
}
List<Element> essentialPluginsElements = JDOMUtil.getChildren(parentNode, ESSENTIAL_PLUGIN);
List<Element> essentialPluginsElements = parentNode.getChildren(ESSENTIAL_PLUGIN);
Collection<String> essentialPluginsIds = ContainerUtil.mapNotNull(essentialPluginsElements, new Function<Element, String>() {
@Override
public String fun(Element element) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,6 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.impl.libraries.LibraryImpl;
import com.intellij.openapi.roots.libraries.LibraryTablesRegistrar;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileFilters;
import com.intellij.openapi.util.io.FileUtil;
@@ -152,7 +151,7 @@ public class ConversionContextImpl implements ConversionContext {
final ExpandMacroToPathMap macros = createExpandMacroMap();
List<File> files = new ArrayList<>();
for (Element module : JDOMUtil.getChildren(modules, ModuleManagerImpl.ELEMENT_MODULE)) {
for (Element module : modules.getChildren(ModuleManagerImpl.ELEMENT_MODULE)) {
String filePath = module.getAttributeValue(ModuleManagerImpl.ATTRIBUTE_FILEPATH);
filePath = macros.substitute(filePath, true);
files.add(new File(FileUtil.toSystemDependentName(filePath)));
@@ -228,9 +227,8 @@ public class ConversionContextImpl implements ConversionContext {
//todo[nik] support jar directories
final Element classesChild = libraryElement.getChild("CLASSES");
if (classesChild != null) {
final List<Element> roots = JDOMUtil.getChildren(classesChild, "root");
final ExpandMacroToPathMap pathMap = createExpandMacroMap(moduleSettings);
for (Element root : roots) {
for (Element root : classesChild.getChildren("root")) {
final String url = root.getAttributeValue("url");
final String path = VfsUtilCore.urlToPath(url);
files.add(new File(PathUtil.getLocalPath(pathMap.substitute(path, true))));
@@ -27,6 +27,7 @@ import java.util.List;
@SuppressWarnings({"HardCodedStringLiteral"})
public class JDOMExternalizerUtil {
private static final String VALUE_ATTR_NAME = "value";
public static void writeField(@NotNull Element root, @NotNull @NonNls String fieldName, String value) {
@@ -44,7 +45,7 @@ public class JDOMExternalizerUtil {
@Nullable
public static String readField(@NotNull Element parent, @NotNull @NonNls String fieldName) {
for (Element element : JDOMUtil.getChildren(parent, "option")) {
for (Element element : parent.getChildren("option")) {
String childName = element.getAttributeValue("name");
if (Comparing.strEqual(childName, fieldName)) {
return element.getAttributeValue("value");
@@ -54,7 +55,7 @@ public class JDOMExternalizerUtil {
}
public static Element getOption(@NotNull Element parent, @NotNull @NonNls String fieldName) {
for (Element element : JDOMUtil.getChildren(parent, "option")) {
for (Element element : parent.getChildren("option")) {
String childName = element.getAttributeValue("name");
if (Comparing.strEqual(childName, fieldName)) {
return element;
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@ package com.intellij.appengine.converter;
import com.intellij.appengine.facet.AppEngineFacetType;
import com.intellij.conversion.*;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.util.containers.ContainerUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
@@ -54,7 +53,6 @@ public class AppEngineFacetConverterProvider extends ConverterProvider {
}
private static class GoogleAppEngineFacetConversionProcessor extends ConversionProcessor<ModuleSettings> {
@Override
public boolean isConversionNeeded(ModuleSettings settings) {
return !getAppEngineFacetTags(settings).isEmpty();
@@ -70,7 +68,7 @@ public class AppEngineFacetConverterProvider extends ConverterProvider {
if (facetTag != null) {
String facetName = facetTag.getAttributeValue(JpsFacetSerializer.NAME_ATTRIBUTE);
Element configuration = facetTag.getChild(JpsFacetSerializer.CONFIGURATION_TAG);
settings.addFacetElement(AppEngineFacetType.STRING_ID, facetName, (Element)configuration.clone());
settings.addFacetElement(AppEngineFacetType.STRING_ID, facetName, configuration.clone());
}
}
@@ -78,7 +76,7 @@ public class AppEngineFacetConverterProvider extends ConverterProvider {
private static List<Element> getAppEngineFacetTags(@NotNull ModuleSettings settings) {
List<Element> appEngineFacetTags = new ArrayList<>();
for (Element webFacetTag : settings.getFacetElements("web")) {
for (Element childFacetTag : JDOMUtil.getChildren(webFacetTag, JpsFacetSerializer.FACET_TAG)) {
for (Element childFacetTag : webFacetTag.getChildren(JpsFacetSerializer.FACET_TAG)) {
if (AppEngineFacetType.STRING_ID.equals(childFacetTag.getAttributeValue(JpsFacetSerializer.TYPE_ATTRIBUTE))) {
appEngineFacetTags.add(childFacetTag);
}