diff options
author | Vincent Lorenzo | 2019-07-04 11:30:43 +0000 |
---|---|---|
committer | vincent lorenzo | 2019-07-08 08:17:02 +0000 |
commit | e6b3ee51505c77be27d2e75001033940b314c177 (patch) | |
tree | f628d2fe748fd70b4b2849a4d4fd29bb4e0fd5cc /plugins/infra/core/org.eclipse.papyrus.infra.core | |
parent | 6c4331a52f9bfbeda3d744b9f5a054094becf61d (diff) | |
download | org.eclipse.papyrus-e6b3ee51505c77be27d2e75001033940b314c177.tar.gz org.eclipse.papyrus-e6b3ee51505c77be27d2e75001033940b314c177.tar.xz org.eclipse.papyrus-e6b3ee51505c77be27d2e75001033940b314c177.zip |
Bug 548973: The method resource.save is not called (class AbstractDynamicModel)
Change-Id: Ie477a9a91a2dc0c0dae57dcd6c53600ef47c6919
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins/infra/core/org.eclipse.papyrus.infra.core')
3 files changed, 20 insertions, 6 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF b/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF index a0914659456..687e8c6c46f 100644 --- a/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF +++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/META-INF/MANIFEST.MF @@ -31,7 +31,7 @@ Require-Bundle: org.eclipse.emf.workspace;bundle-version="[1.5.0,2.0.0)", org.eclipse.papyrus.infra.core.architecture;bundle-version="[2.0.0,3.0.0)" Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 3.0.100.qualifier +Bundle-Version: 3.0.200.qualifier Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-Activator: org.eclipse.papyrus.infra.core.Activator diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/pom.xml b/plugins/infra/core/org.eclipse.papyrus.infra.core/pom.xml index 4141e408ef7..2a6be614546 100644 --- a/plugins/infra/core/org.eclipse.papyrus.infra.core/pom.xml +++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/pom.xml @@ -1,4 +1,7 @@ -<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.eclipse.papyrus</groupId> @@ -6,6 +9,6 @@ <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>org.eclipse.papyrus.infra.core</artifactId> - <version>3.0.100-SNAPSHOT</version> + <version>3.0.200-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project>
\ No newline at end of file diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractDynamicModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractDynamicModel.java index 0a750f2f017..4b6402f2970 100644 --- a/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractDynamicModel.java +++ b/plugins/infra/core/org.eclipse.papyrus.infra.core/src/org/eclipse/papyrus/infra/core/resource/AbstractDynamicModel.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2010, 2015 LIFL, CEA LIST, Christian W. Damus, and others. + * Copyright (c) 2010, 2015, 2019 LIFL, CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -11,7 +11,7 @@ * Contributors: * LIFL - Initial API and implementation * Christian W. Damus - bug 481149 - * + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - bug 548973 *****************************************************************************/ package org.eclipse.papyrus.infra.core.resource; @@ -35,6 +35,10 @@ import org.eclipse.emf.ecore.EObject; */ public abstract class AbstractDynamicModel<T extends EObject> extends AbstractBaseModel { + /** + * boolean indicating than the resource contains or containing something previously and must be saved + */ + private boolean containsSomethingInThePast = false; /** * @@ -83,8 +87,15 @@ public abstract class AbstractDynamicModel<T extends EObject> extends AbstractBa */ @Override public void saveModel() throws IOException { + // we check if the resource contains something + if (false == this.containsSomethingInThePast) { + this.containsSomethingInThePast = getResource().getContents().size() > 0; + } - if (getResource().getContents().size() <= 0) { + /* + * the resource is empty and has always been empty + */ + if (false == this.containsSomethingInThePast && getResource().getContents().size() <= 0) { return; } |