[Demonstration 1]

[Buggy Method]
public static void main(String[] Args) {
    python = new Snake('R');
    Gui gui = new Gui(1600, 1600);
    //make a gameboard
    Thread snakeRunner = new Thread(new Runnable() {

        private boolean running = true;

        public void stopInTheNameOfLove() {
            running = false;
        }

        @Override
        public void run() {
            while (running) {
                while (python.isAlive()) {
                    if (!gui.isPaused()) {
                        gui.labelMessage(2);
                        dir = gui.getDir();
                        System.out.println(dir);
                        python.changeDir(dir);
                        python.updateSnake();
                        if (!python.isAlive()) {
                            stopInTheNameOfLove();
                        }
                    } else {
                        gui.labelMessage(1);
                        try {
                            Thread.sleep(10);
                        } catch (InterruptedException ex) {
                            ex.printStackTrace();
                        }
                    }
                    //gui stuff
                }
                //more gui stuff
            }
        }
    }, "snakeRunner");
    gui.labelMessage(0);
    while (!gui.isRunning()) {
        try {
            Thread.sleep(10);
        } catch (InterruptedException ex) {
            ex.printStackTrace();
        }
    }
    gui.labelMessage(2);
    snakeRunner.start();
}

[Buggy Hunk]
Gui gui = new Gui(1600,1600);

[Patch]
Gui gui = new Gui(1920*2/3,1080*2/3);

[Demonstration 2]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    Thread thread = new Thread(new MyRunnable());
    thread.start();
    PointsData pointsData = new PointsData();
    pointsData.setLatitude(15);
    pointsData.setLongitude(30);
    pointsData.setNom("testNomligne");
    pointsData.setAdresse("testadresse");
    pointsData.setLigne("testligne");
    pointsData.setIdLine(2);
    pointsData.save();
    List<PointsData> point = SQLite.select().from(PointsData.class).queryList();
    System.out.println("point = " + point);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    //setSupportActionBar(toolbar);
    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {

        @Override
        public boolean onNavigationItemSelected(@NonNull MenuItem item) {
            int id = item.getItemId();
            if (id == R.id.ligne1) {
                chooseOneLayer(1);
            } else if (id == R.id.ligne2) {
                chooseOneLayer(2);
            } else if (id == R.id.ligne3) {
                chooseOneLayer(3);
            } else if (id == R.id.ligne4) {
                chooseOneLayer(4);
            } else if (id == R.id.ligne5) {
                chooseOneLayer(5);
            } else if (id == R.id.ligne6) {
                chooseOneLayer(6);
            } else if (id == R.id.ligne7) {
                chooseOneLayer(7);
            } else if (id == R.id.ligne21) {
                chooseOneLayer(21);
            } else if (id == R.id.all) {
                addAllLayer();
            }
            DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
            drawer.closeDrawer(GravityCompat.START);
            return true;
        }
    });
    currCtx = this;
    try {
        csvLines = readCsv();
    } catch (IOException e) {
        e.printStackTrace();
    }
    mapView = mapFragment.getView();
}

[Buggy Hunk]
Thread thread = new Thread(new MyRunnable());

[Patch]
Thread thread = new Thread(new MyRunnable(this));

[Demonstration 3]

[Buggy Method]
@Override
public void onExecute() {
    System.out.println("=> onExecute");
}

[Buggy Hunk]
System.out.println("=> onExecute");

[Patch]
System.out.println("=> onExecute " + id);