in org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyNatureHelper.java [77:115]
public static void removeNature(final IProject project) {
try {
if (!hasNature(project)) {
return;
}
final IProjectDescription description = project.getDescription();
final String[] ids = description.getNatureIds();
if (ids == null || ids.length == 0) {
// wtf ? it has the Ivy nature but there is none ?
return;
}
int i;
for (i = 0; i < ids.length; i++) {
if (IVY_NATURE_ID.equals(ids[i])) {
break;
}
}
if (i == ids.length) {
// wtf ? it has the Ivy nature but we cannot find it ?
return;
}
final String[] newIds = new String[ids.length - 1];
if (i > 0) {
System.arraycopy(ids, 0, newIds, 0, i);
}
if (i < ids.length - 1) {
System.arraycopy(ids, i + 1, newIds, i, ids.length - i - 1);
}
description.setNatureIds(newIds);
project.setDescription(description, null);
} catch (Exception e) {
IvyPlugin.logError(
"Failed to remove Ivy dependency management on " + project.getName(), e);
}
}