From ef7bf38ef0ac9d4a35d971fc74483b11d367e74f Mon Sep 17 00:00:00 2001 From: Daniel Ratiu <ratiu@fortiss.org> Date: Wed, 19 Feb 2014 15:12:14 +0000 Subject: [PATCH] GREEN refs 1940 --- .../tooling/kernel/extension/IMigrationProvider.java | 12 +++++------- .../tooling/kernel/internal/LibraryService.java | 2 +- .../tooling/kernel/internal/MigrationService.java | 12 ++++++------ .../tooling/kernel/internal/PersistencyService.java | 3 +-- .../eclipse/EclipseResourceStorageProvider.java | 2 +- .../tooling/kernel/service/IMigrationService.java | 2 +- .../tooling/kernel/service/IPersistencyService.java | 2 +- 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IMigrationProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IMigrationProvider.java index ba9bf60da..3ab543ee6 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IMigrationProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IMigrationProvider.java @@ -33,7 +33,7 @@ import org.fortiss.tooling.kernel.service.base.IObjectAware; * @author mou * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 27DD99D2F4AB22CA803D51E3D356AB93 + * @ConQAT.Rating GREEN Hash: BF78C8E1DCF8BC2C65D5E7E369AD2762 */ public interface IMigrationProvider extends IObjectAware<ITopLevelElement> { @@ -42,9 +42,8 @@ public interface IMigrationProvider extends IObjectAware<ITopLevelElement> { * model element. * * The parameter "unknownFeatures" returns a map indicating the features that are not recognized - * in the model. - * This can be useful to detect features coming from old models and can be then translated to - * the new model by the migrator. + * in the model. This can be useful to detect features coming from old models and can be then + * translated to the new model by a migrator. */ boolean needMigration(ITopLevelElement modelElement, Map<EObject, AnyType> unknownFeatures); @@ -52,9 +51,8 @@ public interface IMigrationProvider extends IObjectAware<ITopLevelElement> { * Applies the provider to the given element. * * The parameter "unknownFeatures" returns a map indicating the features that are not recognized - * in the model. - * This can be useful to detect features coming from old models and can be then translated to - * the new model by the migrator. + * in the model. This can be useful to detect features coming from old models and can be then + * translated to the new model by a migrator. * * The migrator should remove from unknownFeatures the features that it dealt with. * If one forgets to do so, the migrator will run into an infinite loop! diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java index 307d8efe8..0fe1d4640 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java @@ -52,7 +52,7 @@ import org.fortiss.tooling.kernel.utils.UniqueIDUtils; * @author ratiu * @author $Author: ratiu $ * @version $Rev: 5274 $ - * @ConQAT.Rating YELLOW Hash: AB6843729245B2961222D42F9DB397EB + * @ConQAT.Rating GREEN Hash: 2977661E2B7E553BA36BC598C58DE5E1 */ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandler<EObject>> implements ILibraryService { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java index 3d05abb57..54a889639 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java @@ -17,6 +17,7 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; +import static org.fortiss.tooling.kernel.utils.LoggingUtils.error; import static org.fortiss.tooling.kernel.utils.MigrationUtils.featuresToStrings; import java.util.Map; @@ -29,7 +30,6 @@ import org.fortiss.tooling.kernel.extension.IMigrationProvider; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.service.IMigrationService; import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase; -import org.fortiss.tooling.kernel.utils.LoggingUtils; /** * This class implements the {@link IMigrationService} interface. @@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils; * @author mou * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: D41B3F3BD99B6BC9ECA3F6B4B795A807 + * @ConQAT.Rating GREEN Hash: 94CF991051EC3755EE8DD07285A6CC93 */ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> implements IMigrationService { @@ -55,7 +55,7 @@ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> /** {@inheritDoc} */ @Override public boolean needMigration(ITopLevelElement input, Map<EObject, AnyType> unknownFeatures) { - return(getProvider(input, unknownFeatures) != null); + return getProvider(input, unknownFeatures) != null; } /** {@inheritDoc} */ @@ -69,18 +69,18 @@ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> while(null != (provider = getProvider(input, unknownFeatures))) { provider.migrate(input, unknownFeatures); } - if(unknownFeatures.size() >= 1) + if(!unknownFeatures.isEmpty()) { throw new RuntimeException(input.getSaveableName() + " contains one or more unknown feature(s): " + featuresToStrings(unknownFeatures)); + } } }); try { input.doSave(new NullProgressMonitor()); } catch(Exception e) { - LoggingUtils.error(ToolingKernelActivator.getDefault(), - "Error during migration of model!", e); + error(ToolingKernelActivator.getDefault(), "Error during migration of model!", e); if(e instanceof RuntimeException) { throw (RuntimeException)e; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java index afd0dcd9a..22454af7a 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java @@ -54,7 +54,7 @@ import org.osgi.framework.Bundle; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 086ACCFAE6CEC64777D6DEC7BB23BADB + * @ConQAT.Rating GREEN Hash: 3CBB6E12FCF1DC7E65F09D4C3CFDE9CE */ public class PersistencyService implements IPersistencyService { @@ -124,7 +124,6 @@ public class PersistencyService implements IPersistencyService { try { EObject rootElement = context.getRootModelElement(); ILibraryService.INSTANCE.ensureChildrenLibraryReferenceAreUpToDate(rootElement); - context.doSave(monitor); } catch(CoreException e) { error(ToolingKernelActivator.getDefault(), "Error during save operation.", e); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java index 773caa8d4..8f17410fc 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java @@ -65,7 +65,7 @@ import org.osgi.framework.Bundle; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 92AA964C5B5676011D12861C0412C980 + * @ConQAT.Rating GREEN Hash: 7D53A64E9CC3E4935054398CD04F6A7C */ public class EclipseResourceStorageProvider implements IEclipseResourceStorageService, IResourceChangeListener, IResourceDeltaVisitor, IStorageProvider { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java index 63cde14f0..64bfd9ef2 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java @@ -30,7 +30,7 @@ import org.fortiss.tooling.kernel.internal.MigrationService; * @author mou * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 9275EB22F8F3218FC5A0BA636584B46F + * @ConQAT.Rating GREEN Hash: 872F825EEDD44952AD6012AFC47B07C6 */ public interface IMigrationService { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java index 5313239de..f6e73acf5 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java @@ -42,7 +42,7 @@ import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: E544C327EB75939E5E64F99500A2D8E2 + * @ConQAT.Rating GREEN Hash: 74906795F7A3AA1D94476D9B0538052C */ public interface IPersistencyService { -- GitLab