From 4adb553d14a93eff7f4428bb2fdbfa58ca49c43f Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 13 Dec 2006 13:37:11 +0000 Subject: [PATCH] Fix for 167549, location representation in PDOM. --- .../org/eclipse/cdt/internal/core/pdom/PDOM.java | 1 + .../pdom/dom/PDOMProjectIndexLocationConverter.java | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java index 4b3e9c1cddd..7f89a8c4e33 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java @@ -90,6 +90,7 @@ public class PDOM extends PlatformObject implements IIndexFragment, IPDOM { // 18 - distinction between c-unions and c-structs. // 19 - alter representation of paths in the pdom (162172) // 20 - add pointer to member types, array types, return types for functions + // 21 - change representation of paths in the pdom (167549) public static final int LINKAGES = Database.DATA_AREA; public static final int FILE_INDEX = Database.DATA_AREA + 4; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMProjectIndexLocationConverter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMProjectIndexLocationConverter.java index b31e087abed..aebd345438e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMProjectIndexLocationConverter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMProjectIndexLocationConverter.java @@ -25,12 +25,10 @@ import org.eclipse.core.runtime.Path; * The standard location converter used by the per-project PDOM */ public class PDOMProjectIndexLocationConverter implements IIndexLocationConverter { - IProject project; IWorkspaceRoot root; private static final String EXTERNAL = ""; //$NON-NLS-1$ public PDOMProjectIndexLocationConverter(IProject project) { - this.project = project; this.root = ResourcesPlugin.getWorkspace().getRoot(); } @@ -47,9 +45,9 @@ public class PDOMProjectIndexLocationConverter implements IIndexLocationConverte uri = null; } } else { - fullPath = "/"+project.getName()+"/"+raw; //$NON-NLS-1$//$NON-NLS-2$ - IResource member = project.findMember(raw); - uri = member == null ? null : member.getLocationURI(); + fullPath = raw; + IResource member= root.getFile(new Path(raw)); + uri = member.getLocationURI(); } return new IndexFileLocation(uri, fullPath); } @@ -60,7 +58,7 @@ public class PDOMProjectIndexLocationConverter implements IIndexLocationConverte public String toInternalFormat(IIndexFileLocation location) { String result; if(location.getFullPath()!=null) { - result = new Path(location.getFullPath()).removeFirstSegments(1).toString(); + result = new Path(location.getFullPath()).toString(); } else { result = EXTERNAL+location.getURI().toString(); }