[Demonstration 1]

[Buggy Method]
@Test
public void numDoors() {
    int door = 0;
    for (BoardCell[] i : board.getBoard()) {
        for (BoardCell j : i) {
            if (j != null && j.isDoorway()) {
                ++door;
            }
        }
    }
    assertEquals(NUM_DOORS, door);
}

[Buggy Hunk]
if (j != null && j.isDoorway()) {

[Patch]
if (j.isDoorway()) {

[Demonstration 2]

[Buggy Method]
public void onGet() {
    long cid = this.getLong("cid");
    Circling c = Circling.load(cid);
    this.set("cid", cid);
    this.set("c", c);
    login = getUser();
    this.set("me", login);
    Follower f = c.getFollower(login);
    if (c.isPrivate() && (f == null || !f.getPost())) {
        log.warn("deny to access the circling, user=" + login + ", circling=" + cid);
        this.deny("/forum", null);
        return;
    }
    int s = this.getInt("s");
    int n = this.getInt("n", 20, "number.per.page");
    Beans<Topic> bs = null;
    String name = this.getString("name");
    if (!X.isEmpty(name) && X.isEmpty(path)) {
        bs = new Beans<Topic>();
        /**
         * searching
         */
        Query q1 = SE.parse(name, new String[] { "title", "nickname", "content" });
        TopDocs docs = SE.search("topic", q1);
        ScoreDoc[] dd = docs.scoreDocs;
        bs.setTotal(docs.totalHits);
        List<Topic> list = new ArrayList<Topic>();
        bs.setList(list);
        int min = s + n;
        int i = s;
        while (i < min && i < dd.length) {
            ScoreDoc d = dd[i];
            long id = X.toLong(SE.get(d.doc), -1);
            if (id > -1) {
                Topic e = Topic.load(id);
                // SE.highlight();
                String s1 = SE.highlight(d.doc, "title", q1, null);
                if (s1 != null) {
                    e.set("title", s1);
                }
                list.add(e);
            }
            i++;
            if (list.size() >= n) {
                break;
            }
        }
        this.set("name", name);
    } else {
        bs = Topic.load(W.create("cid", cid).and("parent", 0).sort("top", -1).sort("updated", -1), s, n);
    }
    this.set(bs, s, n);
    this.query.path("/forum/topic");
    /**
     * get recommends
     */
    Beans<Circling> bs1 = Circling.load(login.getId(), W.create().sort("updated", -1), 0, 20);
    this.set("recommends", bs1 == null ? null : bs1.getList());
    this.show("/forum/topic.index.html");
}

[Buggy Hunk]
Beans<Circling> bs1 = Circling.load(login.getId(), W.create().sort("updated", -1), 0, 20);

[Patch]
Beans<Circling> bs1 = Circling.load(login == null ? -1 : login.getId(), W.create().sort("updated", -1), 0, 20);

[Demonstration 3]

[Buggy Method]
@Override
public synchronized void onPlayerConnected(String id) {
}

[Buggy Hunk]
public synchronized void onPlayerConnected(String id) {

[Patch]
public void onPlayerConnected(String id) {