mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 235289: [mylyn] AssertionFailedException when expanding binaries
This commit is contained in:
parent
8758582793
commit
e8b7f79fc4
1 changed files with 16 additions and 4 deletions
|
@ -41,6 +41,7 @@ import org.eclipse.cdt.core.model.CModelException;
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.model.CoreModelUtil;
|
import org.eclipse.cdt.core.model.CoreModelUtil;
|
||||||
import org.eclipse.cdt.core.model.IBuffer;
|
import org.eclipse.cdt.core.model.IBuffer;
|
||||||
|
import org.eclipse.cdt.core.model.ICContainer;
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.core.model.IContributedModelBuilder;
|
import org.eclipse.cdt.core.model.IContributedModelBuilder;
|
||||||
|
@ -1088,14 +1089,25 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
|
||||||
@Override
|
@Override
|
||||||
public void getHandleMemento(StringBuilder buff) {
|
public void getHandleMemento(StringBuilder buff) {
|
||||||
if (getResource() == null) {
|
if (getResource() == null) {
|
||||||
|
// external translation unit
|
||||||
((CElement)getCProject()).getHandleMemento(buff);
|
((CElement)getCProject()).getHandleMemento(buff);
|
||||||
buff.append(getHandleMementoDelimiter());
|
buff.append(getHandleMementoDelimiter());
|
||||||
final IPath location= getLocation();
|
final IPath fileLocation= getLocation();
|
||||||
if (location != null) {
|
if (fileLocation != null) {
|
||||||
escapeMementoName(buff, location.toPortableString());
|
escapeMementoName(buff, fileLocation.toPortableString());
|
||||||
}
|
}
|
||||||
} else {
|
} else if (getParent() instanceof ICContainer) {
|
||||||
|
// regular case: translation unit under source container
|
||||||
super.getHandleMemento(buff);
|
super.getHandleMemento(buff);
|
||||||
|
} else {
|
||||||
|
// translation unit below a binary
|
||||||
|
((CElement)getCProject()).getHandleMemento(buff);
|
||||||
|
buff.append(getHandleMementoDelimiter());
|
||||||
|
// project relative path
|
||||||
|
final IPath projectPath= getResource().getFullPath().removeFirstSegments(1);
|
||||||
|
if (projectPath != null) {
|
||||||
|
escapeMementoName(buff, projectPath.toPortableString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue