1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

nolonger throws bogus exception when .cdtproject id does not match

This commit is contained in:
David Inglis 2004-05-26 14:48:13 +00:00
parent 3f5fd52006
commit 4a12e51cb9
2 changed files with 9 additions and 15 deletions

View file

@ -266,14 +266,6 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
if (cproject == null) {
cproject = create(file.getProject());
}
/////////////////////////////////////////////////
// FIXME-alain: Quick hack 'til we fix the CDescriptor
// This should/must be remove
// ".cdtproject" is a special file for CProjects.
/////////////////////////////////////////////////
if (file.getName().equals(".cdtproject")) { // $NON-NLS-1$
return null;
}
boolean checkIfBinary = false;
ICElement celement = null;
try {

View file

@ -101,14 +101,16 @@ public class CDescriptor implements ICDescriptor {
if (descriptionPath.toFile().exists()) {
IStatus status;
String ownerID = readCDTProjectFile(descriptionPath);
if (ownerID.equals(id)) {
status = new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, CCorePlugin.STATUS_CDTPROJECT_EXISTS,
CCorePlugin.getResourceString("CDescriptor.exception.projectAlreadyExists"), (Throwable)null); //$NON-NLS-1$
} else {
status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, CCorePlugin.STATUS_CDTPROJECT_MISMATCH,
CCorePlugin.getResourceString("CDescriptor.exception.unmatchedOwnerId"), (Throwable)null); //$NON-NLS-1$
if (!ownerID.equals("")) { //$NON-NLS-1$
if (ownerID.equals(id)) {
status = new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, CCorePlugin.STATUS_CDTPROJECT_EXISTS,
CCorePlugin.getResourceString("CDescriptor.exception.projectAlreadyExists"), (Throwable)null); //$NON-NLS-1$
} else {
status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, CCorePlugin.STATUS_CDTPROJECT_MISMATCH,
CCorePlugin.getResourceString("CDescriptor.exception.unmatchedOwnerId") + "<requested:" +id +"/ In file:" +ownerID+">", (Throwable)null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
throw new CoreException(status);
}
throw new CoreException(status);
}
fOwner = new COwner(manager.getOwnerConfiguration(id));
fOwner.configure(project, this);