Minor changes (constants, headers, obsolete code)
diff --git a/plugins/org.eclipse.app4mc.amalthea.converters.200/src/org/eclipse/app4mc/amalthea/converters200/impl/SchedulerConverter.java b/plugins/org.eclipse.app4mc.amalthea.converters.200/src/org/eclipse/app4mc/amalthea/converters200/impl/SchedulerConverter.java index 1971d61..86c7eff 100644 --- a/plugins/org.eclipse.app4mc.amalthea.converters.200/src/org/eclipse/app4mc/amalthea/converters200/impl/SchedulerConverter.java +++ b/plugins/org.eclipse.app4mc.amalthea.converters.200/src/org/eclipse/app4mc/amalthea/converters200/impl/SchedulerConverter.java
@@ -40,10 +40,6 @@ import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; -/** - * @author mlh2sh - * - */ @Component( property = { ServiceConstants.INPUT_MODEL_VERSION_PROPERTY + "=1.2.0", @@ -56,6 +52,13 @@ private static final String VALUE = "value"; private static final String UNIT = "unit"; private static final String EXTENDED = "extended: "; + private static final String SCHEDULING_ALGORITHM = "schedulingAlgorithm"; + private static final String SCHEDULING_PARAMETERS = "schedulingParameters"; + private static final String PARAMETER_EXTENSIONS = "parameterExtensions"; + private static final String PRIORITY = "priority"; + private static final String MIN_BUDGET = "minBudget"; + private static final String MAX_BUDGET = "maxBudget"; + private static final String REPLENISHMENT2 = "replenishment"; @Reference SessionLogger logger; @@ -173,14 +176,14 @@ String type = elem.getAttributeValue("type", xsi).substring(3); // type without prefix "am:" // remove child element "schedulingAlgorithm" - parent.removeChild("schedulingAlgorithm"); + parent.removeChild(SCHEDULING_ALGORITHM); // add link to definition String definition = findSchedulerDefinitionName(elem, type); String link = HelperUtil.encodeName(definition) + "?type=SchedulerDefinition"; // store parameter extensions of (user specific) algorithm within parent - for (Element paramExt : elem.getChildren("parameterExtensions")) { + for (Element paramExt : elem.getChildren(PARAMETER_EXTENSIONS)) { String key = paramExt.getAttributeValue(KEY); String value = paramExt.getAttributeValue(VALUE); addSchedulingParameter(parent, EXTENDED + key, "am:StringObject", value, null); @@ -222,27 +225,27 @@ Element parent = elem.getParentElement(); // remove old single child element "schedulingParameters" - parent.removeChild("schedulingParameters"); + parent.removeChild(SCHEDULING_PARAMETERS); // add new multiple child elements "schedulingParameters" - String priorityValue = elem.getAttributeValue("priority"); + String priorityValue = elem.getAttributeValue(PRIORITY); if (! priorityValue.equals("0")) { - addIntegerSchedulingParameter(parent, "priority", priorityValue); + addIntegerSchedulingParameter(parent, PRIORITY, priorityValue); } - Element minBudget = elem.getChild("minBudget"); + Element minBudget = elem.getChild(MIN_BUDGET); if (minBudget != null) { - addTimeSchedulingParameter(parent, "minBudget", minBudget); + addTimeSchedulingParameter(parent, MIN_BUDGET, minBudget); } - Element maxBudget = elem.getChild("maxBudget"); + Element maxBudget = elem.getChild(MAX_BUDGET); if (maxBudget != null) { - addTimeSchedulingParameter(parent, "maxBudget", maxBudget); + addTimeSchedulingParameter(parent, MAX_BUDGET, maxBudget); } - Element replenishment = elem.getChild("replenishment"); + Element replenishment = elem.getChild(REPLENISHMENT2); if (replenishment != null) { - addTimeSchedulingParameter(parent, "replenishment", replenishment); + addTimeSchedulingParameter(parent, REPLENISHMENT2, replenishment); } } @@ -261,7 +264,7 @@ String value = elem.getAttributeValue(VALUE); // remove old child element "parameterExtensions" - parent.removeChild("parameterExtensions"); + parent.removeChild(PARAMETER_EXTENSIONS); // add new child elements "schedulingParameters" addSchedulingParameter(parent, EXTENDED + key, "am:StringObject", value, null); @@ -274,8 +277,8 @@ private String findSchedulerDefinitionName(Element algorithmElement, String type) { if (type.equals("UserSpecificSchedulingAlgorithm")) { // collect parameter names - List<String> parameters = algorithmElement.getChildren("parameterExtensions").stream() - .map(param -> param.getAttributeValue("key")) + List<String> parameters = algorithmElement.getChildren(PARAMETER_EXTENSIONS).stream() + .map(param -> param.getAttributeValue(KEY)) .collect(Collectors.toList()); // find the algorithm with the correct parameters @@ -313,7 +316,7 @@ private void addSchedulingParameter(Element parent, String definition, String type, String value, String unit) { // create parameter element - Element parameterElement = new Element("schedulingParameters"); + Element parameterElement = new Element(SCHEDULING_PARAMETERS); parent.addContent(parameterElement); // add parameter key
diff --git a/plugins/org.eclipse.app4mc.amalthea.converters.common/src/org/eclipse/app4mc/amalthea/converters/common/utils/AmaltheaNamespaceRegistry.java b/plugins/org.eclipse.app4mc.amalthea.converters.common/src/org/eclipse/app4mc/amalthea/converters/common/utils/AmaltheaNamespaceRegistry.java index b9dd131..17aef44 100644 --- a/plugins/org.eclipse.app4mc.amalthea.converters.common/src/org/eclipse/app4mc/amalthea/converters/common/utils/AmaltheaNamespaceRegistry.java +++ b/plugins/org.eclipse.app4mc.amalthea.converters.common/src/org/eclipse/app4mc/amalthea/converters/common/utils/AmaltheaNamespaceRegistry.java
@@ -1,6 +1,6 @@ /** ******************************************************************************** - * Copyright (c) 2019, 2021 Robert Bosch GmbH and others. + * Copyright (c) 2019-2021 Robert Bosch GmbH and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0
diff --git a/plugins/org.eclipse.app4mc.amalthea.converters.common/src/org/eclipse/app4mc/amalthea/converters/common/utils/ModelVersion.java b/plugins/org.eclipse.app4mc.amalthea.converters.common/src/org/eclipse/app4mc/amalthea/converters/common/utils/ModelVersion.java index 6c7cece..a88434b 100644 --- a/plugins/org.eclipse.app4mc.amalthea.converters.common/src/org/eclipse/app4mc/amalthea/converters/common/utils/ModelVersion.java +++ b/plugins/org.eclipse.app4mc.amalthea.converters.common/src/org/eclipse/app4mc/amalthea/converters/common/utils/ModelVersion.java
@@ -1,6 +1,6 @@ /** ******************************************************************************** - * Copyright (c) 2015-2020 Robert Bosch GmbH and others. + * Copyright (c) 2015-2021 Robert Bosch GmbH and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -108,11 +108,6 @@ allSupportedVersions.add(allVersions[i].value); } - // no support for itea versions - allSupportedVersions.remove("itea.103"); - allSupportedVersions.remove("itea.110"); - allSupportedVersions.remove("itea.111"); - return allSupportedVersions; }