[Demonstration 1]

[Buggy Method]
@Override
protected void onPostExecute(Integer aVoid) {
    super.onPostExecute(aVoid);
    Log.d("control", "onPostExecute");
    Log.d("PositionsOPE", pos[0] + " " + pos[1] + " " + pos[2] + " " + g + " ");
    Picasso.with(getApplicationContext()).load(adPaths.get(pos[0])).placeholder(R.drawable.banner_1).error(R.drawable.banner_1).into(switcher1);
    Picasso.with(getApplicationContext()).load(adPaths.get(pos[1])).placeholder(R.drawable.banner_1).error(R.drawable.banner_1).into(switcher2);
    Picasso.with(getApplicationContext()).load(adPaths.get(pos[2])).placeholder(R.drawable.banner_1).error(R.drawable.banner_1).into(switcher3);
    m_handlerTask = new Runnable() {

        @Override
        public void run() {
            displayAds();
        }
    };
    int time1 = 1000, time2 = 30000;
    if (firstTime == 1)
        m_handler.postDelayed(m_handlerTask, time1);
    else
        m_handler.postDelayed(m_handlerTask, time2);
}

[Buggy Hunk]
int time1 = 1000, time2 = 30000;

[Patch]
int time1 = 3000, time2 = 30000; //switch ads after 3 secs (time to download

[Demonstration 2]

[Buggy Method]
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = { "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" }, justification = "Best effort")
private void rollOver() {
    outputLock.lock();
    try {
        setFile(null);
        if (logDirectry != null) {
            setFile(new File(logDirectry, logFilePrefix + "_" + dateFormat.format(new Date()) + ".log"));
            File[] files = logDirectry.listFiles(new FilenameFilter() {

                public boolean accept(File dir, String name) {
                    return name.startsWith(logFilePrefix) && name.endsWith(".log");
                }
            });
            if (files.length > maxFiles) {
                Arrays.sort(files, new Comparator<File>() {

                    public int compare(File o1, File o2) {
                        long lm1 = o1.lastModified();
                        long lm2 = o2.lastModified();
                        return lm1 < lm2 ? -1 : lm1 == lm2 ? 0 : +1;
                    }
                });
                for (int i = 0; i < files.length - maxFiles; i++) {
                    files[i].delete();
                }
            }
        }
    } catch (FileNotFoundException e) {
        // ignore
    } finally {
        outputLock.unlock();
    }
}

[Buggy Hunk]
if (files.length > maxFiles) {

[Patch]
if (files != null && files.length > maxFiles) {

[Demonstration 3]

[Buggy Method]
public static List<Postit> FetchAllPostits() {
    EntityManagerFactory emfactory = Persistence.createEntityManagerFactory("Eclipselink_JPA");
    EntityManager entitymanager = emfactory.createEntityManager();
    entitymanager.getTransaction().begin();
    TypedQuery<Postit> query = entitymanager.createQuery("SELECT n FROM Postit n", Postit.class);
    List<Postit> result = query.getResultList();
    for (Postit n : result) {
        System.out.println("Postit ID = " + n.getId());
        System.out.println("Postit Author = " + n.getUser());
        System.out.println("Postit CONTENT = " + n.getContentText());
    }
    return result;
}

[Buggy Hunk]
System.out.println("Postit Author = " + n.getUser());

[Patch]
System.out.println("Postit Author = " + n.getAuthor());