[Demonstration 1]

[Buggy Method]
private void queryArticleData(Session session, Article article, boolean comment, boolean recom, boolean media) {
    if (comment) {
        Query query = session.createQuery(" from SWPArticleComment where articleId =?");
        query.setLong(0, article.getId());
        List<SWPArticleComment> list = query.list();
        Iterator<SWPArticleComment> it = list.iterator();
        while (it.hasNext()) {
            SWPArticleComment c = it.next();
            article.addComment(c.getId(), ServiceFactory.getESUserService().getUser(c.getUserId()), c.getComment(), c.getToUserId() <= 0 ? null : ServiceFactory.getESUserService().getUser(c.getToUserId()), c.getTimeStamp().getTime());
        }
    }
    if (recom) {
        Query query = session.createQuery(" from SWPArticleRecommendation where articleId =?");
        query.setLong(0, article.getId());
        List<SWPArticleRecommendation> listRecomend = query.list();
        Iterator<SWPArticleRecommendation> itRecomend = listRecomend.iterator();
        while (itRecomend.hasNext()) {
            SWPArticleRecommendation c = itRecomend.next();
            article.addRecommend(c.getId(), ServiceFactory.getESUserService().getUser(c.getUserId()));
        }
    }
    if (media) {
        Query query = session.createQuery(" from SWPArticlePicture where articleId =?");
        query.setLong(0, article.getId());
        List<SWPArticlePicture> listRecomend = query.list();
        Iterator<SWPArticlePicture> itRecomend = listRecomend.iterator();
        while (itRecomend.hasNext()) {
            SWPArticlePicture c = itRecomend.next();
            article.addMedia(c.getId(), c.getOriginPath(), 0);
        }
    }
}

[Buggy Hunk]
.getESUserService().getUser(c.getToUserId()), c.getTimeStamp().getTime());

[Patch]
.getESUserService().getUser(c.getToUserId()), c.getTimeStamp());

[Demonstration 2]

[Buggy Method]
@Test
public void testGetBoundingBox() {
    SerpentinConfiguration gameConfig = new SerpentinConfiguration();
    GameData gameData = new GameData(gameConfig);
    SerpentinEntityWall sew = new SerpentinEntityWall(gameData, 100, 100);
    Rectangle rect = new Rectangle(sew.getSize(), sew.getSize());
    rect.setLocation(sew.getPostion().x, sew.getPostion().y);
    assertTrue(sew.getBoundingBox().equals(rect));
}

[Buggy Hunk]
rect.setLocation(sew.getPostion().x, sew.getPostion().y);

[Patch]
rect.setLocation(sew.getPosition().x, sew.getPosition().y);

[Demonstration 3]

[Buggy Method]
public void buttonOnClick(View v) {
    switch(v.getId()) {
        case R.id.btn_newItem:
            // Pressed button to add new item to the collection.
            final Intent addIntent = new Intent(this, ItemActivity.class);
            addIntent.putExtra("debugMode", debugMode);
            addIntent.putExtra("Mode", "NewItem");
            startActivity(addIntent);
            break;
        case R.id.btn_collection:
            // Pressed button do show total or filtered collection.
            final Intent codeIntent = new Intent(this, CollectionActivity.class);
            codeIntent.putExtra("debugMode", debugMode);
            codeIntent.putExtra("Mode", "FULL");
            startActivity(codeIntent);
            break;
        case R.id.btn_rental:
            // Pressed button to enter lend administration.
            final Intent rentalIntent = new Intent(this, RentalActivity.class);
            rentalIntent.putExtra("debugMode", debugMode);
            rentalIntent.putExtra("Mode", "Open");
            startActivity(rentalIntent);
            break;
        case R.id.btn_export:
            // Pressed button to enter database export.
            DatabaseOperations db = new DatabaseOperations(this, debugMode);
            try {
                db.exportDatabaseCSV(db);
            } catch (IOException e) {
                e.printStackTrace();
            }
            // Starting file export via mail
            String[] TO = { "" };
            String[] CC = { "" };
            File exportDir = new File(Environment.getExternalStorageDirectory(), "");
            File file = new File(exportDir.getPath() + "/collector.csv");
            Uri uri = Uri.parse("file://" + file);
            Intent emailIntent = new Intent(Intent.ACTION_SEND);
            emailIntent.setData(Uri.parse("mailto:"));
            emailIntent.setType("text/plain");
            emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
            emailIntent.putExtra(Intent.EXTRA_CC, CC);
            emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Export Collector Database");
            emailIntent.putExtra(Intent.EXTRA_TEXT, "Email message goes here");
            emailIntent.putExtra(Intent.EXTRA_STREAM, uri);
            try {
                startActivity(Intent.createChooser(emailIntent, "Send mail..."));
                finish();
            } catch (android.content.ActivityNotFoundException ex) {
                Toast.makeText(MainActivity.this, "There is no email client installed.", Toast.LENGTH_SHORT).show();
            }
            break;
        case R.id.btn_info:
            // Pressed button to display information regarding this app.
            final Intent infoIntent = new Intent(this, InfoActivity.class);
            infoIntent.putExtra("debugMode", debugMode);
            startActivity(infoIntent);
            break;
    }
}

[Buggy Hunk]
db.exportDatabaseCSV(db);

[Patch]
db.exportDatabaseCSV(db, null);