Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-09-03 11:56:42 +0000
committerEike Stepper2013-09-03 11:56:42 +0000
commit2e1532a7c4522da00164d4935f5a3ebb4de3f334 (patch)
treec02500212b81ace1e7d74e3ca13a6861c7df4feb
parentd4f12b239cb5051806042c7b81b1e835b16acf14 (diff)
downloadcdo-2e1532a7c4522da00164d4935f5a3ebb4de3f334.tar.gz
cdo-2e1532a7c4522da00164d4935f5a3ebb4de3f334.tar.xz
cdo-2e1532a7c4522da00164d4935f5a3ebb4de3f334.zip
[416428] NPE in AbstractMappingStrategy.handleRevisions()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=416428
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java33
1 files changed, 23 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java
index e5ceb6a82f..e71c45165e 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/AbstractMappingStrategy.java
@@ -206,14 +206,22 @@ public abstract class AbstractMappingStrategy extends Lifecycle implements IMapp
else
{
EPackage ePackage = eClass.getEPackage();
- if (CDOModelUtil.isCorePackage(ePackage) && !systemPackageMappingInfo.ecoreMapped)
+ if (CDOModelUtil.isCorePackage(ePackage))
{
- return;
+ initSystemPackageMappingInfo();
+ if (!systemPackageMappingInfo.ecoreMapped)
+ {
+ return;
+ }
}
- if (CDOModelUtil.isTypesPackage(ePackage) && !systemPackageMappingInfo.etypesMapped)
+ if (CDOModelUtil.isTypesPackage(ePackage))
{
- return;
+ initSystemPackageMappingInfo();
+ if (!systemPackageMappingInfo.etypesMapped)
+ {
+ return;
+ }
}
IClassMapping classMapping = getClassMapping(eClass);
@@ -490,12 +498,7 @@ public abstract class AbstractMappingStrategy extends Lifecycle implements IMapp
}
}
- if (systemPackageMappingInfo == null)
- {
- systemPackageMappingInfo = new SystemPackageMappingInfo();
- systemPackageMappingInfo.ecoreMapped = hasTableFor(EcorePackage.eINSTANCE.getEPackage());
- systemPackageMappingInfo.etypesMapped = hasTableFor(EtypesPackage.eINSTANCE.getAnnotation());
- }
+ initSystemPackageMappingInfo();
if (!systemPackageMappingInfo.ecoreMapped || !systemPackageMappingInfo.etypesMapped)
{
@@ -561,6 +564,16 @@ public abstract class AbstractMappingStrategy extends Lifecycle implements IMapp
}
}
+ private void initSystemPackageMappingInfo()
+ {
+ if (systemPackageMappingInfo == null)
+ {
+ systemPackageMappingInfo = new SystemPackageMappingInfo();
+ systemPackageMappingInfo.ecoreMapped = hasTableFor(EcorePackage.eINSTANCE.getEPackage());
+ systemPackageMappingInfo.etypesMapped = hasTableFor(EtypesPackage.eINSTANCE.getAnnotation());
+ }
+ }
+
public void removeMapping(Connection connection, InternalCDOPackageUnit[] packageUnits)
{
IDBSchemaTransaction schemaTransaction = store.getDatabase().openSchemaTransaction();

Back to the top