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 ba9bf60dafdf968fbc903b8904d8d9239c0c25bb..3ab543ee605edf9371171044174c1115378b922e 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 307d8efe814dd1f0e0fcbe9f3a6cf2cf4bad210f..0fe1d46409f63eb8548c7ea64fd9354a05b86345 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 3d05abb5712dea60a29723c09d757cd1c545a8cf..54a88963905e833365ec0e7c376b3e431c1f434d 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 afd0dcd9a55040a24624527c29c06538ce13a075..22454af7a2333719fbe24f7edb34b58f8263c202 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 773caa8d4f83a53b52ffe13382293a94467268a0..8f17410fcc80499ec9fa36281a26d87ac0060a1f 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 63cde14f0c6084ade724676c2d388f6e4dbeaa8c..64bfd9ef292b3c2a58b1c9c3e92ae47388d101c5 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 5313239deac65a52927bb03c954946d33dea177c..f6e73acf56ee13dd37fbf85d90dce201a4d1489f 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 {