Commit e1ad7a01 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Project: Fix Internal References for Imported Projects

Issue-Ref: 4059

Signed-off-by: Alexander Diewald's avatarAlexander Diewald <>
parent db8810ae
......@@ -3,7 +3,7 @@ 70e81c85ae7c2d8076e190ebad7eae648451b645 GREEN 054c92406affa0c0ad8ac7a067de9608d0bbca2b GREEN a5a30a0e6b274d220c397d9bf0f14756d49bd19f GREEN 2963d3a1fe651025bae3ae4dc0b6e0b77bbaadd5 GREEN 3452992b488694431110a2e6f6183661accd6695 GREEN f1465eb779a321f3bf895dd5a6983fdfd9e0fa70 YELLOW 83dc50f1fc28c7f1d9dcde9e4e0d02480656b7aa GREEN 54f2397f0d6720c90948ccc295f1a63b7319daac GREEN 031591687c2461a990d0534cf4ed4d6df39b1551 GREEN
......@@ -15,6 +15,7 @@
package org.fortiss.af3.project.utils;
import static org.conqat.lib.commons.filesystem.FileSystemUtils.copyFile;
import static org.conqat.lib.commons.reflect.ReflectionUtils.pickInstanceOf;
import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace;
import static org.fortiss.af3.project.AF3Project.AF3_PRJ_SUFFIX;
......@@ -264,7 +265,11 @@ public final class ProjectUtils {
doCopyExternalDocuments(sourceFileProject, sourceFileURI, targetFileURI);
// Perform the copy to the actual target (workspace) for the kernel to perform the import.
saveProject(sourceFileProject, targetFileURI);
// We need to copy the file instead of creating a new resource from the FileProject since
// few internal references would point to the original file (NOTE: This can only be observed
// with few entities and only with large projects). This indicates a problem in EMF's href
// resolution algorithm.
copyFile(new File(sourceFileURI.toFileString()), new File(targetFileURI.toFileString()));
// Using the Java-API is not directly possible, as we would need to load the file before,
// which could destroy some element references. Using listeners we can avoid the problem by
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment