mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
Fix for 218266: [patch] Wrong path returned for ExternalTranslationUnit working copies (patch by Warren Paul)
This commit is contained in:
parent
8ece714199
commit
a3aab7e451
2 changed files with 13 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue