[Demonstration 1]

[Buggy Method]
public static void main(String[] args) throws NumberFormatException, IOException {
    String fileName = "";
    while (true) {
        fileName = (String) JOptionPane.showInputDialog("Please enter the name of the file you want to edit/create (No blank names)");
        if (fileName != null && !fileName.trim().isEmpty())
            break;
        if (fileName == null)
            System.exit(0);
    }
    CreatorFrame frame = new CreatorFrame();
    CreatorWorld wodrld = new CreatorWorld(fileName);
    CreatorItems items = new CreatorItems(world, null);
    world.setLocation(0, 0);
    items.setLocation(Client.Client.SCREEN_WIDTH, 0);
    frame.add(world);
    frame.add(items);
    world.revalidate();
    items.revalidate();
    frame.setVisible(true);
    items.repaint();
}

[Buggy Hunk]
CreatorWorld wodrld = new CreatorWorld(fileName);

[Patch]
CreatorWorld world = new CreatorWorld(fileName);

[Demonstration 2]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    setButtons();
    setImage();
    update();
    AppPreference appPreference = new AppPreference(getApplicationContext());
}

[Buggy Hunk]
AppPreference appPreference = new AppPreference(getApplicationContext());

[Patch]
this.preference = new AppPreference(getApplicationContext());

[Demonstration 3]

[Buggy Method]
public void recording() {
    Calendar rightNow = Calendar.getInstance();
    final String mFileName = String.format("%s%s%d-%02d-%02d_%02d-%02d-%02d.mp4", filepath.getPath(), File.separator, rightNow.get(Calendar.YEAR), rightNow.get(Calendar.MONTH), rightNow.get(Calendar.DAY_OF_MONTH), rightNow.get(Calendar.HOUR), rightNow.get(Calendar.MINUTE), rightNow.get(Calendar.SECOND));
    final MediaRecorder mRecorder = new MediaRecorder();
    mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
    mRecorder.setOutputFile(mFileName);
    mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
    mRecorder.setAudioChannels(1);
    mRecorder.setAudioSamplingRate(44100);
    mRecorder.setAudioEncodingBitRate(44100);
    try {
        mRecorder.prepare();
        mRecorder.start();
    } catch (IOException e) {
        e.printStackTrace();
        Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();
        return;
    }
    final File oldFilePath = new File(mFileName);
    final AlertDialog.Builder builder = new AlertDialog.Builder(this);
    LayoutInflater inflater = this.getLayoutInflater();
    final View dialogView = inflater.inflate(R.layout.dialog_rename_file, null);
    EditText editText = (EditText) dialogView.findViewById(R.id.edit_filename);
    editText.setText(oldFilePath.getName());
    editText.setSelection(0, oldFilePath.getName().length() - 4);
    builder.setTitle("Enter new filename").setView(dialogView).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            EditText editText = (EditText) dialogView.findViewById(R.id.edit_filename);
            String newFilePath = oldFilePath.getParent() + File.separator + editText.getText().toString();
            oldFilePath.renameTo(new File(newFilePath));
            refreshFileList();
        }
    }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            oldFilePath.delete();
        }
    });
    AlertDialog.Builder abuilder = new AlertDialog.Builder(this);
    abuilder.setTitle("Recording").setOnDismissListener(new DialogInterface.OnDismissListener() {

        @Override
        public void onDismiss(DialogInterface dialog) {
            mRecorder.stop();
            mRecorder.release();
            builder.create().show();
        }
    });
    abuilder.create().show();
}

[Buggy Hunk]
abuilder.setTitle("Recording")

[Patch]
abuilder.setMessage("Recording")