Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2022-04-26 06:17:38 +0000
committerEd Merks2022-04-26 06:17:38 +0000
commitd25929249b0206c8ddfd550aa689b0122f499276 (patch)
treebaa6cc5409d3349f1b96f8534a2b87861a6f9abb
parent468f04dbf198a58e26ceb1fd44a714f2e4cacba4 (diff)
downloadorg.eclipse.emf-d25929249b0206c8ddfd550aa689b0122f499276.tar.gz
org.eclipse.emf-d25929249b0206c8ddfd550aa689b0122f499276.tar.xz
org.eclipse.emf-d25929249b0206c8ddfd550aa689b0122f499276.zip
[579760] Validator for affiliation annotation doesn't find cross package
references
-rw-r--r--features/org.eclipse.emf.ecore-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.ecore-feature/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.codegen.ecore/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.ecore.xcore/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.ecore/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/ExtendedMetaDataAnnotationValidator.java36
7 files changed, 42 insertions, 8 deletions
diff --git a/features/org.eclipse.emf.ecore-feature/feature.xml b/features/org.eclipse.emf.ecore-feature/feature.xml
index 64dc1f54a..fec7a3531 100644
--- a/features/org.eclipse.emf.ecore-feature/feature.xml
+++ b/features/org.eclipse.emf.ecore-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.emf.ecore"
label="%featureName"
- version="2.27.0.qualifier"
+ version="2.28.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.emf.license"
license-feature-version="2.11.0">
diff --git a/features/org.eclipse.emf.ecore-feature/pom.xml b/features/org.eclipse.emf.ecore-feature/pom.xml
index 2a0b0cb2f..9da5de131 100644
--- a/features/org.eclipse.emf.ecore-feature/pom.xml
+++ b/features/org.eclipse.emf.ecore-feature/pom.xml
@@ -12,7 +12,7 @@
<groupId>org.eclipse.emf.features</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
- <version>2.27.0-SNAPSHOT</version>
+ <version>2.28.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.codegen.ecore/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.codegen.ecore/META-INF/MANIFEST.MF
index 4b6f7d03d..cac6302b7 100644
--- a/plugins/org.eclipse.emf.codegen.ecore/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.codegen.ecore/META-INF/MANIFEST.MF
@@ -23,7 +23,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.6.0,4.0.0)",
org.eclipse.jdt.core;bundle-version="[3.6.0,4.0.0)",
org.eclipse.jdt.launching;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.26.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.ecore;bundle-version="[2.27.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.codegen;bundle-version="[2.22.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="[2.16.0,3.0.0)",
org.eclipse.text;bundle-version="[3.5.0,4.0.0)"
diff --git a/plugins/org.eclipse.emf.ecore.xcore/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.ecore.xcore/META-INF/MANIFEST.MF
index 69bae938d..3dd4dfe57 100644
--- a/plugins/org.eclipse.emf.ecore.xcore/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.ecore.xcore/META-INF/MANIFEST.MF
@@ -10,7 +10,7 @@ Bundle-Activator: org.eclipse.emf.ecore.xcore.XcorePlugin$Implementation
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xtext;bundle-version="[2.13.0,3.0.0)";visibility:=reexport,
org.apache.log4j;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
- org.eclipse.emf.ecore;bundle-version="[2.26.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.ecore;bundle-version="[2.27.0,3.0.0)";visibility:=reexport,
org.eclipse.xtext.util;bundle-version="[2.18.0,3.0.0)",
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
org.eclipse.xtext.xbase;bundle-version="[2.18.0,3.0.0)";visibility:=reexport,
diff --git a/plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF
index 9a7cea093..2e2b61985 100644
--- a/plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.ecore/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.ecore;singleton:=true
-Bundle-Version: 2.26.0.qualifier
+Bundle-Version: 2.27.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.emf.ecore.plugin.EcorePlugin$Implementation$Activator
Bundle-Vendor: %providerName
@@ -22,7 +22,7 @@ Export-Package: org.eclipse.emf.ecore,
org.eclipse.emf.ecore.xml.type.internal,
org.eclipse.emf.ecore.xml.type.util
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)";resolution:=optional;x-installation:=greedy,
- org.eclipse.emf.common;bundle-version="[2.24.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.common;bundle-version="[2.25.0,3.0.0)";visibility:=reexport,
org.eclipse.core.resources;bundle-version="[3.6.0,4.0.0)";resolution:=optional
Import-Package: javax.crypto,
javax.crypto.spec,
diff --git a/plugins/org.eclipse.emf.ecore/pom.xml b/plugins/org.eclipse.emf.ecore/pom.xml
index 11aba09a0..c8a9b1d22 100644
--- a/plugins/org.eclipse.emf.ecore/pom.xml
+++ b/plugins/org.eclipse.emf.ecore/pom.xml
@@ -12,7 +12,7 @@
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
- <version>2.26.0-SNAPSHOT</version>
+ <version>2.27.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/ExtendedMetaDataAnnotationValidator.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/ExtendedMetaDataAnnotationValidator.java
index b8eb7190f..35d7b6cca 100644
--- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/ExtendedMetaDataAnnotationValidator.java
+++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/ExtendedMetaDataAnnotationValidator.java
@@ -22,6 +22,7 @@ import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicReference;
+import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
@@ -30,6 +31,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.common.util.Enumerator;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EAnnotationValidator;
import org.eclipse.emf.ecore.EAttribute;
@@ -245,7 +247,39 @@ public final class ExtendedMetaDataAnnotationValidator extends BasicEAnnotationV
}
else
{
- specializedExtendedMetaData = new SpecializedExtendedMetaData(new EPackageRegistryImpl(resourceSet.getPackageRegistry()));
+ final ResourceSet theResourceSet = resourceSet;
+ EPackage.Registry ePackageRegistry = new EPackageRegistryImpl(resourceSet.getPackageRegistry())
+ {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public EPackage getEPackage(String nsURI)
+ {
+ EPackage result = super.getEPackage(nsURI);
+ if (result == null)
+ {
+ for (TreeIterator<Notifier> allContents = theResourceSet.getAllContents(); allContents.hasNext(); )
+ {
+ Notifier content = allContents.next();
+ if (content instanceof EPackage)
+ {
+ EPackage ePackage = (EPackage)content;
+ String ePackageNsURI = ePackage.getNsURI();
+ if (ePackageNsURI == null ? nsURI == null : ePackageNsURI.equals(nsURI))
+ {
+ return ePackage;
+ }
+ }
+ else if (content instanceof EObject)
+ {
+ allContents.prune();
+ }
+ }
+ }
+ return result;
+ }
+ };
+ specializedExtendedMetaData = new SpecializedExtendedMetaData(ePackageRegistry);
}
EXTENDED_META_DATA_CACHE.put(resourceSet, specializedExtendedMetaData);
}

Back to the top