Skip to content
Snippets Groups Projects
Commit ef7bf38e authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

GREEN

refs 1940
parent ce608bd5
No related branches found
No related tags found
No related merge requests found
......@@ -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!
......
......@@ -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 {
......
......@@ -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;
......
......@@ -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);
......
......@@ -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 {
......
......@@ -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 {
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment