Skip to content
Snippets Groups Projects
Commit 5ca2ce59 authored by Simon Barner's avatar Simon Barner
Browse files

getReferencingResourceURIs():

 - Ignore directories when trying to find sidecar model files
 - Suppress console message in case a package in a model file could not be found
parent 84dd1610
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,7 @@ import java.util.stream.Collectors; ...@@ -34,6 +34,7 @@ import java.util.stream.Collectors;
import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.ResourcesPlugin;
...@@ -48,6 +49,7 @@ import org.eclipse.emf.ecore.resource.ResourceSet; ...@@ -48,6 +49,7 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.PackageNotFoundException;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl; import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl; import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
import org.eclipse.emf.ecore.xml.type.AnyType; import org.eclipse.emf.ecore.xml.type.AnyType;
...@@ -62,7 +64,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService; ...@@ -62,7 +64,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @author mou * @author mou
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: A14278605586372E3CCEE85B91CF34CD * @ConQAT.Rating YELLOW Hash: E6CBD4C9FC74A32B1386D76FC50D4CD1
*/ */
public final class ResourceUtils { public final class ResourceUtils {
...@@ -394,7 +396,7 @@ public final class ResourceUtils { ...@@ -394,7 +396,7 @@ public final class ResourceUtils {
} }
for(IResource member : members) { for(IResource member : members) {
if(member.equals(file)) { if(member.equals(file) || member instanceof IFolder) {
continue; continue;
} }
...@@ -415,8 +417,10 @@ public final class ResourceUtils { ...@@ -415,8 +417,10 @@ public final class ResourceUtils {
siblingResource.unload(); siblingResource.unload();
} catch(Exception e) { } catch(Exception e) {
error(ToolingKernelActivator.getDefault(), if(!(e.getCause() instanceof PackageNotFoundException)) {
"Failed to load \"" + member.getName(), e); error(ToolingKernelActivator.getDefault(),
"Failed to load \"" + member.getName(), e);
}
} }
if(progressMonitor != null) { if(progressMonitor != null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment