From b0ea093470b018b632c97b64d4eca400c212e6ce Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Sun, 20 Oct 2013 02:00:57 -0400 Subject: [PATCH] Bug 419915 - Organize includes adds wrong path prefix Set the device id to null in the include path because, as the javadoc for removeFirstSegments says, the device id is preserved. Change-Id: I1f57d1ff7133326b306451b22a1ce7665aec3d85 Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/17555 Reviewed-by: Sergey Prigogin --- .../cdt/internal/corext/codemanipulation/InclusionContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/InclusionContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/InclusionContext.java index eca6e46f842..f121ad18061 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/InclusionContext.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/codemanipulation/InclusionContext.java @@ -131,7 +131,7 @@ public class InclusionContext { !fCurrentDirectory.isPrefixOf(fullPath)) { return null; } - shortestInclude = fullPath.removeFirstSegments(fCurrentDirectory.segmentCount()).toString(); + shortestInclude = fullPath.setDevice(null).removeFirstSegments(fCurrentDirectory.segmentCount()).toString(); } include = new IncludeInfo(shortestInclude, isSystem); // Don't put an include to fullPath to fIncludeResolutionCache since it may be wrong