diff options
Diffstat (limited to 'core/org.eclipse.cdt.core/model/org')
2 files changed, 13 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ExternalTranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ExternalTranslationUnit.java index ebeac1b4ca8..5cb8466a25c 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ExternalTranslationUnit.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ExternalTranslationUnit.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 QNX Software Systems and others. + * Copyright (c) 2000, 2008 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,6 +8,7 @@ * Contributors: * QNX Software Systems - Initial API and implementation * Anton Leherbauer (Wind River Systems) + * Warren Paul (Nokia) - Bug 218266 *******************************************************************************/ package org.eclipse.cdt.internal.core.model; @@ -15,7 +16,6 @@ package org.eclipse.cdt.internal.core.model; import java.net.URI; import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.core.runtime.IPath; /** * ExternalTranslationUnit @@ -29,9 +29,5 @@ public class ExternalTranslationUnit extends TranslationUnit { public ExternalTranslationUnit(ICElement parent, URI uri, String contentTypeID) { super(parent, uri, contentTypeID); } - - public IPath getPath() { - return getLocation(); - } } 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 1286f89ed0d..a962a18ce1c 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 @@ -10,6 +10,7 @@ * Markus Schorn (Wind River Systems) * IBM Corporation * Anton Leherbauer (Wind River Systems) + * Warren Paul (Nokia) - Bug 218266 *******************************************************************************/ package org.eclipse.cdt.internal.core.model; @@ -928,5 +929,15 @@ public class TranslationUnit extends Openable implements ITranslationUnit { return result != null ? result : getLanguage(); } + public IPath getPath() { + if (getFile() != null) { + return super.getPath(); + } + IPath path= getLocation(); + if (path != null) { + return path; + } + return super.getPath(); + } } |