From 424cfd22117ad1ff141150b1a29f00090847b989 Mon Sep 17 00:00:00 2001 From: David Inglis Date: Tue, 1 Jun 2004 18:32:12 +0000 Subject: [PATCH] [scalability] TU check for existance should just be resource test instead of parsing the file. --- .../cdt/internal/core/model/TranslationUnit.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java index 39b41a113a7..98d92175332 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java @@ -573,6 +573,17 @@ public class TranslationUnit extends Openable implements ITranslationUnit { String lid = type.getLanguage().getId(); return lid != null && lid.equals(ICFileTypeConstants.LANG_ASM); } + + + /* (non-Javadoc) + * @see org.eclipse.cdt.core.model.ICElement#exists() + */ + public boolean exists() { + IResource res = getResource(); + if (res != null) + return res.exists(); + return super.exists(); + } }