X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Finternal%2FProjectFeatureRegistry.java;fp=bundles%2Forg.simantics.project%2Fsrc%2Forg%2Fsimantics%2Fproject%2Finternal%2FProjectFeatureRegistry.java;h=b07304ed1ce3b8d39af3c5c8d06b1dd5cc6ccf3e;hp=e861bc09dc47e81f3b1857889c835db091837048;hb=19c8e2d3eba80a750c6fb92de11a209a8132f8c7;hpb=03b0440388d6f2638c9b205debe3a82afd811fc9 diff --git a/bundles/org.simantics.project/src/org/simantics/project/internal/ProjectFeatureRegistry.java b/bundles/org.simantics.project/src/org/simantics/project/internal/ProjectFeatureRegistry.java index e861bc09d..b07304ed1 100644 --- a/bundles/org.simantics.project/src/org/simantics/project/internal/ProjectFeatureRegistry.java +++ b/bundles/org.simantics.project/src/org/simantics/project/internal/ProjectFeatureRegistry.java @@ -94,7 +94,7 @@ public class ProjectFeatureRegistry implements IProjectFeatureRegistry, IExtensi String description = StringUtils.safeString(el.getAttribute("description")); boolean published = "true".equalsIgnoreCase(el.getAttribute("published")); Collection requires = readProjectFeatureReferenceCollection(el, "requires"); - Collection injections = readInjectedDependencies(el); + Collection injections = readInjectedDependencies(el, id); Collection installGroups = readGroupReferenceCollection(el, "installGroup"); ProjectFeatureExtension ext = new ProjectFeatureExtension(el, id, label, description, published, requires, injections, installGroups); @@ -111,19 +111,17 @@ public class ProjectFeatureRegistry implements IProjectFeatureRegistry, IExtensi this.extensions = newExtensions.toArray(new IProjectFeatureExtension[newExtensions.size()]); } - private Collection readInjectedDependencies(IConfigurationElement element) { + private Collection readInjectedDependencies(IConfigurationElement element, String id) { Collection result = new ArrayList(); for (IConfigurationElement child : element.getChildren(INJECT_DEPENDENCY)) { - String id = StringUtils.safeString(child.getAttribute("id")); - if (id.isEmpty()) - // Invalid extension - return null; - String targetId = StringUtils.safeString(child.getAttribute("targetId")); if (targetId.isEmpty()) // Invalid extension return null; + + result.add(new InjectedDependency(new ProjectFeatureReference(id, false), new ProjectFeatureReference(targetId, false))); + } return result;