[Demonstration 1]

[Buggy Method]
@Override
public Session getSession() {
    Factory.startup();
    Factory.initThread();
    return Factory.fromLotus(super.getSession(), Session.SCHEMA, null);
}

[Buggy Hunk]
Factory.initThread();

[Patch]
Factory.initThread(Factory.STRICT_THREAD_CONFIG);

[Demonstration 2]

[Buggy Method]
@Override
protected Control createContents(Composite parent) {
    parent.setSize(new Point(400, 400));
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new GridLayout(3, false));
    vueHall = new VueHall(container, SWT.NONE);
    vueHall.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 2, 3));
    vueHall.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
    simulation = new Simulation(vueHall);
    Composite composite = new Composite(container, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 2));
    composite.setLayout(new FillLayout(SWT.HORIZONTAL));
    btnManuel = new Button(composite, SWT.TOGGLE);
    btnManuel.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            actionSetManuel.run();
        }
    });
    btnManuel.setText("Manuel");
    btnAutomatique = new Button(composite, SWT.TOGGLE);
    btnAutomatique.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            actionSetAuto.run();
        }
    });
    btnAutomatique.setText("Automatique");
    Group grpProperties = new Group(container, SWT.NONE);
    GridData gd_grpProperties = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 2);
    gd_grpProperties.minimumWidth = 150;
    gd_grpProperties.widthHint = 200;
    grpProperties.setLayoutData(gd_grpProperties);
    grpProperties.setLayout(new FillLayout(SWT.HORIZONTAL));
    grpProperties.setText("Propriétés");
    propertiesWidget = new PropertiesWidget(grpProperties, SWT.NONE, null);
    simulation.setPropertiesWidget(propertiesWidget);
    CLabel lblVitesse = new CLabel(container, SWT.NONE);
    lblVitesse.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
    lblVitesse.setAlignment(SWT.RIGHT);
    lblVitesse.setText("Vitesse de la simulation");
    Scale sclVitesse = new Scale(container, SWT.NONE);
    GridData gd_sclVitesse = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_sclVitesse.widthHint = 100;
    gd_sclVitesse.minimumWidth = 100;
    sclVitesse.setLayoutData(gd_sclVitesse);
    return container;
}

[Buggy Hunk]
vueHall = new VueHall(container, SWT.NONE);

[Patch]
vueHall = new VueHall(container, SWT.NONE | SWT.NO_BACKGROUND);

[Demonstration 3]

[Buggy Method]
public boolean isHookReady() throws IOException {
    String response;
    try {
        response = getResponse(hookReadyUrl);
    } catch (IOException e) {
        this.log.info("Can't connect to hook, probably not ready");
        return false;
    }
    JsonObject json = new JsonParser().parse(response).getAsJsonObject();
    log.info(response);
    return (json != null && json.getAsJsonObject("data").getAsJsonPrimitive("ready").getAsBoolean());
}

[Buggy Hunk]
public boolean isHookReady() throws IOException {

[Patch]
public boolean isHookReady() {