[Demonstration 1]

[Buggy Method]
private void selectStealFamily(int index) {
    if (strikes == FamilyFeudGame.STRIKE_LIMIT) {
        selectedFamilyIndex = index;
        Logger.log("Family [" + selectedFamilyIndex + "] selected as potential stealers.");
    }
    Logger.err("Cannot assign family [" + index + "] as stealers: " + (FamilyFeudGame.STRIKE_LIMIT - strikes) + " strike(s) remaining");
}

[Buggy Hunk]
Logger.err("Cannot assign family [" + index + "] as stealers: " + (FamilyFeudGame.STRIKE_LIMIT - strikes) + " strike(s) remaining");

[Patch]
else Logger.err("Cannot assign family [" + index + "] as stealers: " + (FamilyFeudGame.STRIKE_LIMIT - strikes) + " strike(s) remaining");

[Demonstration 2]

[Buggy Method]
protected static void initialize() {
    Properties startupProperties = new Properties();
    startupProperties.put("dataDir", System.getProperty("java.io.tmpdir"));
    startupProperties.put("clientPort", PORT);
    QuorumPeerConfig quorumConfiguration = new QuorumPeerConfig();
    try {
        quorumConfiguration.parseProperties(startupProperties);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    zooKeeperServer = new ZooKeeperServerMain();
    final ServerConfig configuration = new ServerConfig();
    configuration.readFrom(quorumConfiguration);
    new Thread() {

        public void run() {
            try {
                zooKeeperServer.runFromConfig(configuration);
            } catch (IOException e) {
                logger.error("ZkServerStarter initialize error", e);
            }
        }
    }.start();
}

[Buggy Hunk]
startupProperties.put("dataDir", System.getProperty("java.io.tmpdir"));

[Patch]
startupProperties.put("dataDir", System.getProperty("java.io.tmpdir")+'/'+System.nanoTime());

[Demonstration 3]

[Buggy Method]
public void configure(Properties props) throws Exception {
    if (props.getProperty("config.file") == null) {
        throw new Exception("Missing configuration file: " + ExecutionState.DEFAULT_CONFIG);
    }
    SimpleCredentialStore scs = new SimpleCredentialStore();
    scs.add(props);
    RemotePlugin.setCredentialStore(scs);
    if (dir != null) {
        RemotePlugin.setDataDirectory(dir);
    }
    plugin = new RemotePlugin(props.getProperty(SimpleCredentialStore.PROP_HOSTNAME));
}

[Buggy Hunk]
throw new Exception("Missing configuration file: " + ExecutionState.DEFAULT_CONFIG);

[Patch]
throw new Exception("Missing configuration file: " + DEFAULT_FILE);