if (!facet.uninstallRequirements() || !mutable.uninstall(facet))
throw new Exception(String.format("Could not uninstall %s from %s.", facet.getClass(), project));
final ProjectConfig projectConfig = project.getFacet(ProjectConfig.class);
SerializableSet installed = projectConfig.getProjectProperty(ProjectProperty.INSTALLED_FEATURES,
SerializableSet.class);
if (installed == null)
installed = new SerializableSet();
installed.remove(feature.getShortName());
projectConfig.setProjectProperty(ProjectProperty.INSTALLED_FEATURES, installed);
}
catch (Exception e) {
throw new Exception("Could not remove " + feature.getLongName(), e);