Skip to content
Snippets Groups Projects
Commit a5537087 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Revert 21f4d0f3


Issue-Ref: 3746
Signed-off-by: default avatarAlexander Diewald <diewald@fortiss.org>
parent 3e69bef5
No related branches found
No related tags found
No related merge requests found
......@@ -37,11 +37,9 @@
</extension>
<extension point="org.fortiss.tooling.kernel.migrationProvider">
<migrationProvider migrationProvider="org.fortiss.tooling.base.migration.AddMissingAnnotationsMigrationProvider">
<objectClass objectClass="org.fortiss.tooling.kernel.extension.data.ITopLevelElement"/>
</migrationProvider>
<migrationProvider migrationProvider="org.fortiss.tooling.base.migration.RemoveDuplicatedAnnotationsMigrationProvider">
<objectClass objectClass="org.fortiss.tooling.kernel.extension.data.ITopLevelElement"/>
</migrationProvider>
</extension>
</plugin>
AddMissingAnnotationsMigrationProvider.java 8424a4e54cd747e2d9af9b85d8b9d4a2440456c3 GREEN
RemoveDuplicatedAnnotationsMigrationProvider.java f1bdb4733d5b9c6003a2b7fee59b89240a0a3b61 GREEN
RemoveOutdatedAnnotationInstanceMigrationProvider.java 29c29f2bb7515cad1de45a30ffc185001b47a016 GREEN
/*-------------------------------------------------------------------------+
| Copyright 2019 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.migration;
import static org.fortiss.tooling.base.utils.AnnotationUtils.instantiateAnnotationsRecursive;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.kernel.extension.IMigrationProvider;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
/**
* Adds missing annotations to {@link IModelElement}s.
*
* @author diewald
*/
public class AddMissingAnnotationsMigrationProvider implements IMigrationProvider {
/** Remembers the processed {@link ITopLevelElement}s. */
Collection<ITopLevelElement> migratedProjects = new ArrayList<>();
/** {@inheritDoc} */
@Override
public boolean needMigration(ITopLevelElement modelElement,
Map<EObject, AnyType> unknownFeatures) {
if(migratedProjects.contains(modelElement)) {
return false;
}
return true;
}
/** {@inheritDoc} */
@Override
public void migrate(ITopLevelElement modelElement, Map<EObject, AnyType> unknownFeatures) {
EObject rootElement = modelElement.getRootModelElement();
instantiateAnnotationsRecursive(rootElement);
migratedProjects.add(modelElement);
}
}
AngleUtils.java 462551eae71738ff51f92c9906bff9a21a375d2b GREEN
AnnotationUtils.java 7b1b9e02e720871505669bc58b4830c52c9b88f6 GREEN
AnnotationUtils.java 33664d078a6663415037faf38f0924feec170e78 GREEN
BaseMathUtils.java 65f6c39b641cba3c984a38f42b1bbf7dbf3287a3 GREEN
BaseModelElementUtils.java b8775b7a462efc168cf79a017aa3377a782d10f6 GREEN
ConstraintsBaseUtils.java bba938b43756ce6f35c338f6cef21c3ab5d49a9d GREEN
......
......@@ -314,7 +314,8 @@ public class AnnotationUtils {
as.instantiateAnnotations((IModelElement)element);
}
for(IModelElement child : getChildrenWithType(element, IModelElement.class)) {
as.instantiateAnnotations(child);
as.getAnnotationEntry(child);
}
}
}
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