From 10f7e67653f59314eaa331bd8f01cb53cb9cd842 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 11 Jul 2011 15:57:03 +0400 Subject: [PATCH] cleanup --- .../config/EclipseClasspathStorageProvider.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 0e91f2d6f0c8..faaf3ef0651f 100644 --- a/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java +++ b/plugins/eclipse/src/org/jetbrains/idea/eclipse/config/EclipseClasspathStorageProvider.java @@ -110,10 +110,13 @@ public class EclipseClasspathStorageProvider implements ClasspathStorageProvider } static CachedXmlDocumentSet getFileCache(final Module module) { - CachedXmlDocumentSet fileCache = EclipseModuleManager.getInstance(module).getDocumentSet(); + final EclipseModuleManager moduleManager = EclipseModuleManager.getInstance(module); + CachedXmlDocumentSet fileCache = moduleManager != null ? moduleManager.getDocumentSet() : null; if (fileCache == null) { fileCache = new CachedXmlDocumentSet(module.getProject()); - EclipseModuleManager.getInstance(module).setDocumentSet(fileCache); + if (moduleManager != null) { + moduleManager.setDocumentSet(fileCache); + } registerFiles(fileCache, module, ClasspathStorage.getModuleDir(module), ClasspathStorage.getStorageRootFromOptions(module)); fileCache.preload(); } @@ -158,8 +161,7 @@ public class EclipseClasspathStorageProvider implements ClasspathStorageProvider } public CachedXmlDocumentSet getFileSet() { - CachedXmlDocumentSet fileCache = EclipseModuleManager.getInstance(module).getDocumentSet(); - return fileCache != null ? fileCache : getFileCache(module); + return getFileCache(module); } public Set getClasspath(ModifiableRootModel model, final Element element) throws IOException, InvalidDataException {