[Demonstration 1]

[Buggy Method]
public Map<String, File> getLogFiles(FilePath remoteDir) throws InterruptedException, IOException {
    File localCache = cacheDir;
    // build an inventory of what we already have locally
    final Map<String, FileHash> hashes = new LinkedHashMap<String, FileHash>();
    for (File file : localCache.listFiles(filter)) {
        hashes.put(file.getName(), new FileHash(file));
    }
    // figure out what we need to read
    Map<String, Long> offsets = remoteDir.act(new LogFileHashSlurper(hashes, filter));
    evictDeadCache(hashes, offsets);
    // then read those
    Map<String, File> result = new LinkedHashMap<String, File>();
    for (Map.Entry<String, Long> entry : offsets.entrySet()) {
        File local = new File(localCache, entry.getKey());
        if (entry.getValue() > 0 && local.isFile()) {
            final long localLength = local.length();
            if (entry.getValue() < Long.MAX_VALUE) {
                // only copy the new content
                FileOutputStream fos = null;
                InputStream is = null;
                try {
                    fos = new FileOutputStream(local, true);
                    is = read(remoteDir.child(entry.getKey()), localLength);
                    IOUtils.copy(is, fos);
                } finally {
                    IOUtils.closeQuietly(is);
                    IOUtils.closeQuietly(fos);
                }
            }
            result.put(entry.getKey(), local);
        } else {
            FileOutputStream fos = null;
            InputStream is = null;
            try {
                fos = new FileOutputStream(local, false);
                is = read(remoteDir.child(entry.getKey()), 0);
                IOUtils.copy(is, fos);
            } finally {
                IOUtils.closeQuietly(is);
                IOUtils.closeQuietly(fos);
            }
            result.put(entry.getKey(), local);
        }
    }
    return result;
}

[Buggy Hunk]
for (File file : localCache.listFiles(filter)) {

[Patch]
for (File file : Preconditions.checkNotNull(localCache.listFiles(filter))) {

[Demonstration 2]

[Buggy Method]
@Override
public void onBindViewHolder(MyViewHolders holder, int position) {
    DealsListPojo pojo = mList.get(position);
    holder.deals.setText(pojo.getDeal());
    holder.deals.append("% off");
    holder.hospitalName.setText(pojo.getHospitalName());
    holder.description.setText(pojo.getDescription());
    //download image
    if (!pojo.getImageUrl().isEmpty()) {
        String dealImage = EndPoints.IMAGE_BASE_URL + pojo.getImageUrl();
        Glide.with(mContext).load(dealImage).thumbnail(0.5f).diskCacheStrategy(DiskCacheStrategy.ALL).into(holder.hospitalImage);
    }
}

[Buggy Hunk]
holder.description.setText(pojo.getDescription());

[Patch]
holder.description.setText(pojo.getDescription().replace("\\n","\n"));

[Demonstration 3]

[Buggy Method]
@Override
public void onClick(View v) {
    View dialogMatchScore = getLayoutInflater().inflate(R.layout.dialog_match_score, (ViewGroup) v.getRootView(), false);
    ((TextView) dialogMatchScore.findViewById(R.id.player1_name)).setText(currentMatch.getPlayerOne().getName());
    ((TextView) dialogMatchScore.findViewById(R.id.player2_name)).setText(currentMatch.getPlayerTwo().getName());
    (new AlertDialog.Builder(SquashPlayActivity.this)).setCancelable(true).setTitle("Matchday " + championship.indexOf(currentMatchday) + 1).setView(dialogMatchScore).setPositiveButton("Valider", getValidateListener(currentMatch, currentMatchday)).setNegativeButton("Annuler", getCancelListener()).show();
}

[Buggy Hunk]
.setTitle("Matchday " + championship.indexOf(currentMatchday) + 1)

[Patch]
.setTitle("Matchday " + String.valueOf(championship.indexOf(currentMatchday) + 1))