[Demonstration 1]

[Buggy Method]
@Override
public void launch(final ILaunchConfiguration configuration, final String mode, final ILaunch launch, IProgressMonitor monitor) throws CoreException {
    try {
        debug("About to initialize and run the GEMOC Execution Engine...");
        // make sure to have the engine view when starting the engine
        PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {

            @Override
            public void run() {
                ViewHelper.retrieveView(EnginesStatusView.ID);
            }
        });
        // We parse the run configuration
        final RunConfiguration runConfiguration = new RunConfiguration(configuration);
        // We detect if we are running in debug mode or not
        ExecutionMode executionMode = null;
        if (ILaunchManager.DEBUG_MODE.equals(mode)) {
            executionMode = ExecutionMode.Animation;
        } else {
            executionMode = ExecutionMode.Run;
        }
        // We stop the launch if an engine is already running for this model
        if (isEngineAlreadyRunning(runConfiguration.getExecutedModelURI())) {
            return;
        }
        // create and initialize engine
        executionEngine = new XMOFExecutionEngine(false);
        ModelExecutionContext executioncontext = new XMOFExecutionModelContext(runConfiguration, executionMode);
        executioncontext.initializeResourceModel();
        executionEngine.initialize(executioncontext);
        // And we start it within a dedicated job
        Job job = new Job(getDebugJobName(configuration, getFirstInstruction(configuration))) {

            @Override
            protected IStatus run(IProgressMonitor monitor) {
                // If we are debugging, we add the animator and we start
                // the execution using the super class
                // AbstractDSLLaunchConfigurationDelegateUI
                // This will start yet another job and eventually start
                // the engine
                if (ILaunchManager.DEBUG_MODE.equals(mode)) {
                    IEngineAddon animator = AbstractGemocAnimatorServices.getAnimator();
                    executionEngine.getExecutionContext().getExecutionPlatform().addEngineAddon(animator);
                    try {
                        Launcher.super.launch(configuration, mode, launch, monitor);
                        return new Status(IStatus.OK, getPluginID(), "Execution was launched successfully");
                    } catch (CoreException e) {
                        e.printStackTrace();
                        return new Status(IStatus.ERROR, getPluginID(), "Could not start debugger.");
                    }
                } else // If we are not debugging, we simply start the engine
                // from the current job
                {
                    executionEngine.start();
                    debug("Execution finished.");
                    return new Status(IStatus.OK, getPluginID(), "Execution was launched successfully");
                }
            }
        };
        debug("Initialization done, starting engine...");
        job.schedule();
    } catch (Exception e) {
        String message = "Error occured when starting execution engine: " + e.getMessage() + " (see inner exception).";
        // error(message);
        e.printStackTrace();
        throw new CoreException(new Status(Status.ERROR, Activator.PLUGIN_ID, message, e));
    }
}

[Buggy Hunk]
executionEngine = new XMOFExecutionEngine(false);

[Patch]
executionEngine = new XMOFExecutionEngine();

[Demonstration 2]

[Buggy Method]
public static Result service(String ownerName, String projectName, String service, boolean isAdvertise) throws IOException, UnsupportedOperationException, ServletException {
    if (!isSupportedService(service)) {
        return forbidden(String.format("Unsupported service: '%s'", service));
    }
    Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
    if (project == null) {
        return notFound();
    }
    models.User user = UserApp.currentUser();
    if (!isAllowed(project, service)) {
        if (user.isAnonymous()) {
            return BasicAuthAction.unauthorized(response());
        } else {
            // If you want the Git client showing your custom message to
            // the user, the Content-Type should be exact "text/plain"
            // without any parameter. For more details, see the code at
            // https://github.com/git/git/commit/426e70d4a11ce3b4f70636d57c6a0ab16ae08a00#diff-eea0ad565ec5903a11b6023755d491cfR154
            response().setHeader("Content-Type", "text/plain");
            return forbidden(String.format("'%s' has no permission to '%s/%s'.", user.name, ownerName, projectName));
        }
    }
    if (isAdvertise) {
        return ok(RepositoryService.gitAdvertise(project, service, response()));
    } else {
        if (request().body().isMaxSizeExceeded()) {
            return status(REQUEST_ENTITY_TOO_LARGE);
        } else {
            user.visits(project);
            return ok(RepositoryService.gitRpc(project, service, request(), response()));
        }
    }
}

[Buggy Hunk]
user.name, ownerName, projectName));

[Patch]
user.loginId, ownerName, projectName));

[Demonstration 3]

[Buggy Method]
public static IJavaProject importProject(ProjectNode projectNode, IExceptionHandler exceptionHandler) {
    final String projectName = projectNode.getName();
    final AtomicReference<IJavaProject> ar = new AtomicReference<IJavaProject>();
    IWorkspaceRunnable wsr = new IWorkspaceRunnable() {

        @Override
        public void run(IProgressMonitor monitor) throws CoreException {
            try {
                IJavaProject javaProject = createOrOpenProject(projectNode, projectName, monitor);
                if (javaProject != null) {
                    ar.set(javaProject);
                    IProject project = javaProject.getProject();
                    Map<IProject, File> projectsToConnect = new HashMap<IProject, File>();
                    RepositoryFinder finder = new RepositoryFinder(project);
                    finder.setFindInChildren(false);
                    Collection<RepositoryMapping> mappings = finder.find(new SubProgressMonitor(monitor, 1));
                    if (!mappings.isEmpty()) {
                        RepositoryMapping mapping = mappings.iterator().next();
                        projectsToConnect.put(project, mapping.getGitDirAbsolutePath().toFile());
                        ConnectProviderOperation connect = new ConnectProviderOperation(projectsToConnect);
                        connect.execute(monitor);
                    }
                }
            } catch (final Exception e1) {
                Display.getDefault().asyncExec(new Runnable() {

                    @Override
                    public void run() {
                        exceptionHandler.handleException(e1);
                    }
                });
            }
        }
    };
    try {
        ResourcesPlugin.getWorkspace().run(wsr, null);
    } catch (Exception e) {
        exceptionHandler.handleException(e);
    }
    return ar.get();
}

[Buggy Hunk]
public static IJavaProject importProject(ProjectNode projectNode, IExceptionHandler exceptionHandler) {

[Patch]
public static IJavaProject importProject(final ProjectNode projectNode, final IExceptionHandler exceptionHandler) {