From 36771d7d8edc07fdcf7a85067eca0f6c7b4f10b5 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Mon, 14 Apr 2014 19:54:37 +0200 Subject: [PATCH] eclipse: restore root path from .classpath or do not create module at all (IDEA-123946) --- .../config/EclipseClasspathStorageProvider.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java index 5f06150ce0cc..8db305836756 100644 --- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java @@ -202,8 +202,14 @@ public class EclipseClasspathStorageProvider implements ClasspathStorageProvider try { final HashSet usedVariables = new HashSet(); final CachedXmlDocumentSet documentSet = getFileSet(); - final String path = documentSet.getParent(EclipseXml.PROJECT_FILE); - LOG.assertTrue(documentSet.exists(EclipseXml.PROJECT_FILE)); + String path = documentSet.getParent(EclipseXml.PROJECT_FILE); + if (!documentSet.exists(EclipseXml.PROJECT_FILE)) { + if (!documentSet.exists(EclipseXml.CLASSPATH_FILE)) { + return usedVariables; + } + + path = documentSet.getParent(EclipseXml.CLASSPATH_FILE); + } final EclipseClasspathReader classpathReader = new EclipseClasspathReader(path, module.getProject(), null); classpathReader.init(model); if (documentSet.exists(EclipseXml.CLASSPATH_FILE)) {