Source:
protected void restoreAllLink(ModelSet modelSet, Map<URI, URI> constructInternalMapping, IResource copyResources, IPath targetPath) throws IOException { URI uri = URI.createPlatformResourceURI(targetPath.toString(), Boolean.TRUE); Resource resource = modelSet.getResource(uri, Boolean.TRUE); MoveFileURIReplacementStrategy iURIReplacementStrategy = new MoveFileURIReplacementStrategy(new HashMap<URI, URI>(), copyResources.getFullPath().removeLastSegments(1), targetPath.removeLastSegments(1)); RestoreDependencyHelper restoreDependencyHelper = new RestoreDependencyHelper(iURIReplacementStrategy); restoreDependencyHelper.restoreDependencies(resource); for (Entry<URI, URI> oneInternalCopyMapping : constructInternalMapping.entrySet()) { DependencyManagementHelper.updateDependencies(oneInternalCopyMapping.getKey(), oneInternalCopyMapping.getValue(), resource); } resource.save(ResourceUtils.getSaveOptions()); IPath fullPath = copyResources.getFullPath(); Resource sashResource = null; if(DiModel.MODEL_FILE_EXTENSION.equals(fullPath.getFileExtension())) { URI sashModelURI = SashUtils.getSashStateLocationURI(copyResources); sashResource = modelSet.getResource(sashModelURI, true); for(Entry<URI, URI> oneInternalCopyMapping : constructInternalMapping.entrySet()) { DependencyManagementHelper.updateDependencies(oneInternalCopyMapping.getKey(), oneInternalCopyMapping.getValue(), sashResource); } } if (sashResource != null){ URI stashNewFile = SashUtils.getSashStateLocationURI(uri); sashResource.setURI(stashNewFile); sashResource.save(ResourceUtils.getSaveOptions()); } }

Target:
protected void restoreAllLink(ModelSet modelSet, Map<URI, URI> constructInternalMapping, IResource copyResources, IPath targetPath) throws IOException { URI uri = URI.createPlatformResourceURI(targetPath.toString(), Boolean.TRUE); Resource resource = modelSet.getResource(uri, Boolean.TRUE); MoveFileURIReplacementStrategy iURIReplacementStrategy = new MoveFileURIReplacementStrategy(new HashMap<URI, URI>(), copyResources.getFullPath().removeLastSegments(1), targetPath.removeLastSegments(1)); RestoreDependencyHelper restoreDependencyHelper = new RestoreDependencyHelper(iURIReplacementStrategy); restoreDependencyHelper.restoreDependencies(resource); for (Entry<URI, URI> oneInternalCopyMapping : constructInternalMapping.entrySet()) { DependencyManagementHelper.updateDependencies(oneInternalCopyMapping.getKey(), oneInternalCopyMapping.getValue(), resource); } resource.save(ResourceUtils.getSaveOptions()); IPath fullPath = copyResources.getFullPath(); Resource sashResource = null; if (DiModel.MODEL_FILE_EXTENSION.equals(fullPath.getFileExtension())) { SashModel sashModel = SashModelUtils.getSashModel(modelSet); if (sashModel != null && !DiModel.MODEL_FILE_EXTENSION.equals(sashModel.getURI().fileExtension())) { sashResource = sashModel.getResource(); for (Entry<URI, URI> oneInternalCopyMapping : constructInternalMapping.entrySet()) { DependencyManagementHelper.updateDependencies(oneInternalCopyMapping.getKey(), oneInternalCopyMapping.getValue(), sashResource); } } if (sashResource != null) { ModelSet tempModelSet = new DiResourceSet(); tempModelSet.createModels(uri); URI newsashModelURI = SashModelUtils.getSashModel(tempModelSet).getURI(); sashResource.setURI(newsashModelURI); sashResource.save(ResourceUtils.getSaveOptions()); } } }