Skip to content
Snippets Groups Projects
Commit bb225e2b authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Merge remote-tracking branch 'origin/4309' into 4240


Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parents 3e63497d bc321570
No related branches found
No related tags found
1 merge request!1784240
Pipeline #37762 passed
Pipeline: maven-releng

#37763

    CommandLineInterfaceService.java 6b5c94c52702f773c60b181eff52204ab379b248 GREEN
    CommandStackService.java 957bda69b5feb91f002aed4d25ed334e92801e7e GREEN
    ConnectionCompositorService.java 5a52f8a3e88c167ae6909c3d9eb3fb4706177e8b GREEN
    ConstraintCheckerService.java 7aeea15cffbe42b5819dd77f6a386aea18def37d YELLOW
    ConstraintCheckerService.java 2684b145c04498586a6b6c5399bd6c1ab7abf29b YELLOW
    DummyTopLevelElement.java 21807bbdafec2e0ef28f0ee9090218f90bd73aee GREEN
    ElementCompositorService.java b1924b5b349118a70149cfac5b48544897d26e9e GREEN
    LoggingService.java da784259f7b456b54bf75c41ec268f64919ce78d GREEN
    ......
    ......@@ -18,6 +18,7 @@ package org.fortiss.tooling.kernel.internal;
    import static java.util.Collections.emptyList;
    import static java.util.Collections.unmodifiableMap;
    import static org.conqat.lib.commons.reflect.ReflectionUtils.performNearestClassLookup;
    import static org.eclipse.core.runtime.Status.OK_STATUS;
    import java.util.ArrayList;
    import java.util.Collections;
    ......@@ -28,6 +29,9 @@ import java.util.List;
    import java.util.Map;
    import java.util.function.Consumer;
    import org.eclipse.core.runtime.IProgressMonitor;
    import org.eclipse.core.runtime.IStatus;
    import org.eclipse.core.runtime.jobs.Job;
    import org.eclipse.emf.ecore.EObject;
    import org.fortiss.tooling.kernel.extension.IConstraintChecker;
    import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
    ......@@ -53,9 +57,9 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain
    Map<Class<?>, List<IConstraintChecker<EObject>>> asynchronousConstraintCheckers =
    new HashMap<Class<?>, List<IConstraintChecker<EObject>>>();
    /** Maps all constraint checkers to the last started Thread, each. */
    Map<IConstraintChecker<? extends EObject>, Thread> asynchronousChecks =
    new HashMap<IConstraintChecker<? extends EObject>, Thread>();
    /** Maps all constraint checkers to the last started Job, each. */
    Map<IConstraintChecker<? extends EObject>, Job> asynchronousChecks =
    new HashMap<IConstraintChecker<? extends EObject>, Job>();
    /** Returns singleton instance of the service. */
    public static ConstraintCheckerService getInstance() {
    ......@@ -165,24 +169,28 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain
    }
    for(IConstraintChecker<EObject> checker : asyncHandlers) {
    Thread checkerThread = asynchronousChecks.get(checker);
    if(checkerThread != null && checkerThread.isAlive()) {
    checkerThread.interrupt();
    Job checkerJob = asynchronousChecks.get(checker);
    if(checkerJob != null && checkerJob.getThread().isAlive()) {
    checkerJob.cancel();
    }
    checkerThread = new Thread(new Runnable() {
    checkerJob = new Job("Product Line Analysis") {
    @Override
    public void run() {
    protected IStatus run(IProgressMonitor monitor) {
    List<IConstraintViolation<? extends EObject>> results =
    new ArrayList<IConstraintViolation<? extends EObject>>();
    results.addAll(checker.apply(modelElement));
    addMarkers.accept(results);
    return OK_STATUS;
    }
    });
    asynchronousChecks.put(checker, checkerThread);
    };
    asynchronousChecks.put(checker, checkerJob);
    checkerThread.start();
    checkerJob.setUser(false);
    checkerJob.schedule();
    }
    }
    ......
    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