Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Patch for misleading launch error

Please commit this patch to org.eclipse.cdt.launch ...

Pretty Please ;)

-Judy

 Index: ChangeLog
  ===================================================================
  RCS file: /home/tools/org.eclipse.cdt.launch/ChangeLog,v
  retrieving revision 1.8
  diff -u -r1.8 ChangeLog
  --- ChangeLog	14 Nov 2002 19:31:06 -0000	1.8
  +++ ChangeLog	21 Nov 2002 21:26:19 -0000
  @@ -1,3 +1,10 @@
  +2002-11-21 Judy N. Green
  +	*src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
  +	If we cannot get the ICProject with the config, we get the project 
  +	and see if it exists and/or it is closed. The appropriate error is
now
  +	displayed, rather than reporting that the project does not exist
when it
  +	does exist, but is closed.
  +
   2002-11-14 Thomas Fletcher
   	* src/.../launch/ui/CMainTab.java
   	Updated error condition to catch closed projects.



***
cvs diff -N -u "AbstractCLaunchDelegate.java"
  Index: AbstractCLaunchDelegate.java
  ===================================================================
  RCS file:
/home/tools/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunc
hDelegate.java,v
  retrieving revision 1.8
  diff -u -r1.8 AbstractCLaunchDelegate.java
  --- AbstractCLaunchDelegate.java	27 Sep 2002 19:25:38 -0000	1.8
  +++ AbstractCLaunchDelegate.java	21 Nov 2002 21:23:09 -0000
  @@ -197,11 +197,19 @@
   		if (name == null) {
   			abort("C project not specified", null,
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT);
   		}
  -		ICProject project = getCProject(config);
  -		if (project == null) {
  -			abort("Project does not exist or is not a C/C++
project", null, ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
  +		ICProject cproject = getCProject(config);
  +		if (cproject == null) {
  +			IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject(name);
  +			if (!project.exists()){				
  +				abort("Project does not exist", null,
ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
  +			} else {
  +				if(!project.isOpen()){

  +					abort("Project is closed", null,
ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
  +				}
  +			}

  +			abort("Project is not a C/C++ project", null,
ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
   		}
  -		return project;
  +		return cproject;
   	}
   
   	protected IPath verifyProgramFile(ILaunchConfiguration config)
throws CoreException {


Back to the top