From 02bab456aae03156e1a40261f0aa49e9fd349fa6 Mon Sep 17 00:00:00 2001 From: David Inglis Date: Tue, 5 Aug 2003 17:06:19 +0000 Subject: [PATCH] 2003-08-05 Mikhail Khodjaiants * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java Check if the project saved in the launch configuration equals to the project set in the source lookup tab. --- launch/org.eclipse.cdt.launch/ChangeLog | 5 +++++ .../sourcelookup/DefaultSourceLocator.java | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/launch/org.eclipse.cdt.launch/ChangeLog b/launch/org.eclipse.cdt.launch/ChangeLog index b81f2b879eb..ca8ea211e87 100644 --- a/launch/org.eclipse.cdt.launch/ChangeLog +++ b/launch/org.eclipse.cdt.launch/ChangeLog @@ -1,3 +1,8 @@ +2003-08-05 Mikhail Khodjaiants + * src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java + Check if the project saved in the launch configuration equals to the project set + in the source lookup tab. + 2003-07-28 Tom Tromey * src/org/eclipse/cdt/launch/ui/CDebuggerTab.java (loadDebuggerComboBox): Sort entries by name. from diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java index 0b3df3a4510..0a2e38dc9cd 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/sourcelookup/DefaultSourceLocator.java @@ -125,15 +125,19 @@ public class DefaultSourceLocator implements IPersistableSourceLocator, IAdaptab abort( "Unable to restore prompting source locator - invalid format.", null ); } IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject( projectName ); - if ( project != null ) - { - fSourceLocator = new CUISourceLocator( project ); - } - else + if ( project == null ) { abort( MessageFormat.format( "Unable to restore prompting source locator - project {0} not found.", new String[] { projectName } ), null ); } - + ICSourceLocator locator = getCSourceLocator(); + if ( locator == null ) + { + fSourceLocator = new CUISourceLocator( project ); + } + else if ( locator.getProject() != null && !project.equals( locator.getProject() ) ) + { + return; + } IPersistableSourceLocator psl = getPersistableSourceLocator(); if ( psl != null ) {