[Demonstration 1]

[Buggy Method]
private void runPicturePreview(final CommonInfo ai) {
    final boolean attempted = _aiToPreview == ai;
    _aiToPreview = ai;
    final PreconditionInfo detail = _pcList.get(_currentPCIndex);
    final File realFile = new File(_imageFolder, ai.fileName);
    if (!realFile.exists() || realFile.length() < 1024) {
        if (attempted) {
            Toast.makeText(PreConditionActivity.this, "cannot download this imageFile", Toast.LENGTH_SHORT).show();
        } else {
            final DownloadImageAsyncTask task = new DownloadImageAsyncTask(this, -_case.envelopeId, detail.getIndex(), realFile.getPath(), InfoTypeEnum.precond, new IAsyncTaskCallback() {

                @Override
                public void onAsyncTaskComplete(Message msg) {
                    if (Constants.SUCCESS == msg.what) {
                        getHandler().sendEmptyMessage(FILLUP_ADAPTER);
                        runPicturePreview(_aiToPreview);
                    } else {
                        getHandler().sendMessage(msg);
                    }
                }
            });
            task.execute();
        }
    } else {
        Intent i = new Intent(PreConditionActivity.this, PicturePreviewActivity.class);
        i.putExtra("image", realFile.getPath());
        i.putExtra("info", detail.getDetail().getDetailDescription(_case));
        i.putExtra("note", ai.note);
        startActivity(i);
    }
}

[Buggy Hunk]
private void runPicturePreview(final CommonInfo ai) {

[Patch]
private void runPicturePreview(@NonNull final CommonInfo ai) {

[Demonstration 2]

[Buggy Method]
@RequestMapping(method = RequestMethod.GET)
public ResponseEntity<MetricCrudDTO> getMetricDTO(@RequestParam(value = "id", defaultValue = "NA") String id, @RequestParam(value = "version", defaultValue = "NA") String version, @RequestParam(value = "userid", defaultValue = "NA") String userId, @RequestParam(value = "approved", defaultValue = "false") String approved, @RequestParam(value = "state", defaultValue = "NA") String state) {
    MetricCrudDTO dto = new MetricCrudDTO();
    try {
        if (!userId.equals("NA")) {
            dto = metricCRUDController.getMetricOfUser(userId);
            return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.OK);
        }
        if (!id.equals("NA") && approved.equals("true")) {
            dto = metricCRUDController.getMetricCrudDTOByIdLastApprovedVersion(id);
            return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.OK);
        }
        if (!version.equals("NA") && !id.equals("NA")) {
            dto = metricCRUDController.getMetricByIdAndVersion(id, version);
            return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.OK);
        }
        if (!id.equals("NA")) {
            dto = metricCRUDController.getMetricById(id);
            return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.OK);
        }
        if (!userId.equals("NA") && !state.equals("NA")) {
            dto = metricCRUDController.getMetricByStateAndMetricatorId(state, id);
            return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.OK);
        }
        if (userId.equals("NA") && !state.equals("NA")) {
            dto = metricCRUDController.getMetricByState(state);
            return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.OK);
        } else {
            return new ResponseEntity<MetricCrudDTO>(HttpStatus.BAD_REQUEST);
        }
    } catch (BadInputException e) {
        dto.setError(e.getMessage());
        e.printStackTrace();
        return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.BAD_REQUEST);
    } catch (NotFoundException e) {
        dto.setError(e.getMessage());
        e.printStackTrace();
        return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.NOT_FOUND);
    } catch (Exception e) {
        dto.setError(e.getMessage());
        e.printStackTrace();
        return new ResponseEntity<MetricCrudDTO>(dto, HttpStatus.INTERNAL_SERVER_ERROR);
    }
}

[Buggy Hunk]
if (!userId.equals("NA")) {

[Patch]
if (!userId.equals("NA") && state.equals("NA")) {

[Demonstration 3]

[Buggy Method]
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == RESULT_OK) {
        if (requestCode == 1) {
            arrayListFotos.add(imageName);
            showImage(file, imageName);
        } else if (requestCode == 2) {
        }
    }
}

[Buggy Hunk]
arrayListFotos.add(imageName);

[Patch]
arrayListFotos.add("/storage/emulated/0/Android/data/br.com.monster.smokeproject/files/Pictures/"+imageName);