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.CoreModelUtil;
|
||||
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.ICProject;
|
||||
import org.eclipse.cdt.core.model.IContributedModelBuilder;
|
||||
|
@ -1088,14 +1089,25 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
|
|||
@Override
|
||||
public void getHandleMemento(StringBuilder buff) {
|
||||
if (getResource() == null) {
|
||||
// external translation unit
|
||||
((CElement)getCProject()).getHandleMemento(buff);
|
||||
buff.append(getHandleMementoDelimiter());
|
||||
final IPath location= getLocation();
|
||||
if (location != null) {
|
||||
escapeMementoName(buff, location.toPortableString());
|
||||
final IPath fileLocation= getLocation();
|
||||
if (fileLocation != null) {
|
||||
escapeMementoName(buff, fileLocation.toPortableString());
|
||||
}
|
||||
} else {
|
||||
} else if (getParent() instanceof ICContainer) {
|
||||
// regular case: translation unit under source container
|
||||
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