Skip to content
Snippets Groups Projects
Commit 413050c4 authored by Simon Barner's avatar Simon Barner
Browse files

GREEN (with minor cleanup)

Issue-Ref: 4225
Issue-Url: af3#4225



Signed-off-by: default avatarSimon Barner <barner@fortiss.org>
parent a10f09a8
No related branches found
No related tags found
1 merge request!172Manipulated the display order of violation messages in Marker View
Pipeline #33596 passed
Pipeline: maven-releng

#33597

    MarkerViewContentProvider.java 1d188fa2ef7acf075706da36c98dd9562a8d98ca YELLOW
    MarkerViewController.java 75718eb856ee94a7d7ec96b5c285108d74d77b6c YELLOW
    MarkerViewContentProvider.java 761764e4913370e2b99be123209785df8001f93f GREEN
    MarkerViewController.java 75718eb856ee94a7d7ec96b5c285108d74d77b6c GREEN
    MarkerViewPart.java 65d80aaf6a6b1a67dadc5547401fdfd02584add7 GREEN
    MarkerViewUIProvider.java 2a65b0c416f07fffa496099d94936b1a0eaaeb59 GREEN
    ......@@ -39,26 +39,26 @@ public class MarkerViewContentProvider extends DynamicTreeContentProviderBase<Ob
    @SuppressWarnings("unchecked")
    @Override
    public Collection<? extends Object> getChildren(Object parent) {
    Map<ESeverity, Boolean> statusEntries;
    Collection<IConstraintViolation<?>> violation_list =
    new ArrayList<IConstraintViolation<?>>();
    if(parent instanceof Map<?, ?>) {
    statusEntries = (Map<ESeverity, Boolean>)parent;
    Map<ESeverity, Boolean> statusEntries = (Map<ESeverity, Boolean>)parent;
    // sort the entries according to the severity levels to have later a meaningful display
    // order (first FATAL, then ERROR, WARNING, INFO and at the end/bottom DEBUG)
    // Sort the entries types according to the severity levels to have later a meaningful
    // display order (first FATAL, then ERROR, WARNING, INFO and at the end/bottom DEBUG)
    List<Map.Entry<ESeverity, Boolean>> orderedStatusEntries =
    new ArrayList<>(statusEntries.entrySet());
    orderedStatusEntries.sort((mapEntry1, mapEntry2) -> Integer.compare(
    getIntSeverity(mapEntry1.getKey()), getIntSeverity(mapEntry2.getKey())));
    Collection<IConstraintViolation<?>> rval = new ArrayList<IConstraintViolation<?>>();
    IMarkerService ms = IMarkerService.getInstance();
    for(Entry<ESeverity, Boolean> statusEntry : orderedStatusEntries) {
    // Only display selected severity types
    if(statusEntry.getValue()) {
    violation_list.addAll(IMarkerService.getInstance()
    .getAllViolationsWithSeverity(statusEntry.getKey()));
    rval.addAll(ms.getAllViolationsWithSeverity(statusEntry.getKey()));
    }
    }
    return violation_list;
    return rval;
    }
    return null;
    }
    ......
    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