[Demonstration 1]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_quiz_ui);
    lblDifficulty = (TextView) findViewById(R.id.lblDifficulty);
    lblQuestions = (TextView) findViewById(R.id.txtQuestion);
    lblScore = (TextView) findViewById(R.id.lblTextScore);
    lblQuestions.setMovementMethod(new ScrollingMovementMethod());
    cl = (ConstraintLayout) findViewById(R.id.layout);
    //set difficulty text
    Bundle b = getIntent().getExtras();
    difficulty = b.getString("id");
    lblDifficulty.setText("Difficulty: " + difficulty);
    readFile(difficulty);
    Thread thread = new Thread(new Runnable() {

        @Override
        public void run() {
            final long startTime = System.currentTimeMillis();
            while (numberOfAnsweredQuestions < 20) {
                try {
                    Thread.sleep(100);
                    runOnUiThread(new Runnable() {

                        @Override
                        public void run() {
                            double timeSpent = (System.currentTimeMillis() - startTime) / 1000.0;
                            setTime(String.format("%.1f%n", timeSpent));
                        }
                    });
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            long endTime = System.currentTimeMillis();
            long timeTaken = endTime - startTime;
            double timeTakenSeconds = timeTaken / 1000.0;
            Intent i = new Intent(QuizUI.this, EndGame.class);
            i.putExtra("score", "You got " + (score * 100) / 20 + "% accuracy");
            i.putExtra("time", "It took you " + timeTakenSeconds + " seconds to complete 20 questions");
            startActivity(i);
        }
    });
    thread.start();
    //gesture
    gestureDetector = new GestureDetector(QuizUI.this, QuizUI.this);
    //end of gesture
    nextQuestion();
}

[Buggy Hunk]
cl = (ConstraintLayout) findViewById(R.id.layout);

[Patch]
rl = (RelativeLayout) findViewById(R.id.layout);

[Demonstration 2]

[Buggy Method]
private void login() throws IOException {
    LOGGER.info("准备登录，用户名：{},密码：{}", username, password);
    connect = Jsoup.connect(url + "/j_acegi_security_check");
    connect.method(Connection.Method.POST);
    connect.data("j_username", username);
    connect.data("j_password", password);
    connect.data("from", "/");
    connect.data("Submit", "登录");
    connect.data("json", "{\"j_username\": \"" + username + "\", \"j_password\": \"" + password + "\", \"remember_me\": false, \"from\": \"/\"}");
    connect.post();
}

[Buggy Hunk]
private void login() throws IOException {

[Patch]
private synchronized void login() throws IOException {

[Demonstration 3]

[Buggy Method]
public void onItemClick(AdapterView<?> myAdapter, View myView, int myItemInt, long mylng) {
    String tempString = (String) (listView.getItemAtPosition(myItemInt));
    String[] correctArr = a.getValueArr(tempString);
    // Send with string to test atm
    showPopup(listView, correctArr);
    System.out.println(tempString);
}

[Buggy Hunk]
String [] correctArr = a.getValueArr(tempString);

[Patch]
String [] correctArr = ((MainActivity)getActivity()).getValueArr(tempString);