Commit d66d3e7b authored by David Hoksza's avatar David Hoksza
Browse files

fix not working annotations when one of the annotations has a parameter selected

parent 52a9a187
Pipeline #4109 passed with stage
in 1 minute and 4 seconds
......@@ -225,7 +225,7 @@ public class ModelAnnotator {
* @param progressUpdater
* callback function used for updating progress of the function
*/
public void performAnnotations(Model model, final IProgressUpdater progressUpdater) {
public void performAnnotations(Model model, final IProgressUpdater progressUpdater) {
performAnnotations(model, progressUpdater, null, null);
}
......@@ -241,7 +241,7 @@ public class ModelAnnotator {
* callback function used for updating progress of the function
*/
public void performAnnotations(Model model, final IProgressUpdater progressUpdater,
Map<Class<?>, List<ElementAnnotator>> annotators, Map<Class<?>, List<UserAnnotatorsParam>> annotatorsParams) {
Map<Class<?>, List<ElementAnnotator>> annotators, Map<Class<?>, List<UserAnnotatorsParam>> annotatorsParams) {
progressUpdater.setProgress(0);
List<Model> models = new ArrayList<Model>();
models.add(model);
......@@ -338,7 +338,8 @@ public class ModelAnnotator {
* callback function used to refresh progress of function execution
*/
protected void annotateModel(Model model, IProgressUpdater progressUpdater,
Map<Class<?>, List<ElementAnnotator>> annotators, Map<Class<?>, List<UserAnnotatorsParam>> annotatorsParams) {
Map<Class<?>, List<ElementAnnotator>> annotators, Map<Class<?>, List<UserAnnotatorsParam>> annotatorsParams) {
ElementUtils elementUtils = new ElementUtils();
progressUpdater.setProgress(0);
......@@ -355,18 +356,19 @@ public class ModelAnnotator {
if (list == null) {
list = getDefaultAnnotators();
}
for (ElementAnnotator elementAnnotator : list) {
for (ElementAnnotator elementAnnotator : list) {
try {
if (annotatorsParams != null) {
List<UserAnnotatorsParam> params = annotatorsParams.get(elementAnnotator.getClass());
if (params != null) {
elementAnnotator.annotateElement(element, params);
} else {
elementAnnotator.annotateElement(element);
}
} else {
elementAnnotator.annotateElement(element);
}
} catch (AnnotatorException e) {
logger.warn(elementUtils.getElementTag(element) + " " + elementAnnotator.getCommonName()
+ " annotation problem: " + e.getMessage());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment