use of org.eclipse.jdt.internal.corext.refactoring.changes.ClasspathChange in project che by eclipse.
the class DeleteChangeCreator method createPackageFragmentRootDeleteChange.
private static Change createPackageFragmentRootDeleteChange(IPackageFragmentRoot root) throws JavaModelException {
IResource resource = root.getResource();
if (resource != null && resource.isLinked()) {
//XXX using this code is a workaround for jcore bug 31998
//jcore cannot handle linked stuff
//normally, we should always create DeletePackageFragmentRootChange
CompositeChange composite = new DynamicValidationStateChange(RefactoringCoreMessages.DeleteRefactoring_delete_package_fragment_root);
ClasspathChange change = ClasspathChange.removeEntryChange(root.getJavaProject(), root.getRawClasspathEntry());
if (change != null) {
composite.add(change);
}
//checked in preconditions
Assert.isTrue(!Checks.isClasspathDelete(root));
composite.add(createDeleteChange(resource));
return composite;
} else {
Assert.isTrue(!root.isExternal());
// TODO remove the query argument
return new DeletePackageFragmentRootChange(root, true, null);
}
}
Aggregations