/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 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.
@Nullable
private static Set<PsiClass> checkModule(Module module, PsiClass psiClass, @Nullable Set<PsiClass> types, boolean includeActions) {
final XmlFile pluginXml = PluginModuleType.getPluginXml(module);
- if (!DescriptorUtil.isPluginXml(pluginXml)) return types;
- assert pluginXml != null;
+ if (pluginXml == null) return null;
+ final DomFileElement<IdeaPlugin> fileElement = DescriptorUtil.getIdeaPlugin(pluginXml);
+ if (fileElement == null) return null;
final String qualifiedName = psiClass.getQualifiedName();
if (qualifiedName != null) {
processPluginXml(pluginXml, finder, includeActions);
// <depends> plugin.xml files
- final DomFileElement<IdeaPlugin> fileElement = DescriptorUtil.getIdeaPlugin(pluginXml);
for (Dependency dependency : fileElement.getRootElement().getDependencies()) {
final GenericAttributeValue<PathReference> configFileAttribute = dependency.getConfigFile();
if (!DomUtil.hasXml(configFileAttribute)) continue;
/*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 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.
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.xml.DomFileElement;
import com.intellij.util.xml.DomManager;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.devkit.DevKitBundle;
import org.jetbrains.idea.devkit.dom.IdeaPlugin;
if (pluginXml == null) {
return null;
}
- return getIdeaPlugin(pluginXml).getRootElement().getPluginId();
+ final DomFileElement<IdeaPlugin> ideaPlugin = getIdeaPlugin(pluginXml);
+ if (ideaPlugin == null) {
+ return null;
+ }
+
+ return ideaPlugin.getRootElement().getPluginId();
}
public static boolean isPluginXml(PsiFile file) {
return getIdeaPlugin((XmlFile)file) != null;
}
- public static DomFileElement<IdeaPlugin> getIdeaPlugin(XmlFile file) {
+ @Nullable
+ public static DomFileElement<IdeaPlugin> getIdeaPlugin(@NotNull XmlFile file) {
return DomManager.getDomManager(file.getProject()).getFileElement(file, IdeaPlugin.class);
}
}