RealignmentJDSourceMapper jdSourceMapper = (RealignmentJDSourceMapper) existingMapper;
root.setSourceMapper(null);
RealignmentJDSourceMapper.clearDecompiled(jdSourceMapper);
// Re-attach any source which was previously attached
SourceAttachmentDetails details = jdSourceMapper.sourceDetails;
if (details != null)
{
applySourceAttachment(shell, details.newEntry,
details.project, details.containerPath,
details.isReferencedEntry);
}
}
else
{
SourceAttachmentDetails details = null;
if (root.getSourceAttachmentPath() != null)
{
AtomicReference<IPath> containerPath = new AtomicReference<IPath>();
IClasspathEntry entry = getClasspathEntry(root, containerPath);
// Backup existing attachment details
CPListElement backupCpElement = CPListElement.createFromExisting(entry,
root.getJavaProject());
details = new SourceAttachmentDetails(backupCpElement.getClasspathEntry(),
root.getJavaProject(),
containerPath.get(),
entry.getReferencingEntry() != null);
}