[Demonstration 1]

[Buggy Method]
public void render(IContext context) throws Exception {
    // Renderer to use
    IRenderer renderer = getRenderer(context);
    // Action to perform
    IAction action = dispatcher.instantiate(context.getActionClassname(), context);
    // Always dispatch the first action
    if (context.getActionClassname() != null)
        dispatcher.dispatch(context, action);
    // Display in the response
    if (action.needRenderer()) {
        context.getResponse().setCharacterEncoding("UTF-8");
        context.getResponse().setContentType(renderer.getHttpType());
        context.getResponseWriter().write(renderer.render(context));
    }
}

[Buggy Hunk]
if(action.needRenderer()) {

[Patch]
if(action != null && action.needRenderer()) {

[Demonstration 2]

[Buggy Method]
public void create(ScriptScanner scanner) throws IOException {
    TeaseLib.log("Scanning script '" + scanner.getScriptName() + "'");
    Set<String> created = new HashSet<String>();
    for (Message message : scanner) {
        Actor actor = message.actor;
        File characterDir = createSubDir(speechDir, actor.name);
        // Process voices for each character
        final Voice voice;
        voice = getVoice(actor);
        TeaseLib.log("Voice: " + voice.name);
        ttsPlayer.textToSpeech.setVoice(voice);
        File voiceDir = createSubDir(characterDir, voice.guid);
        createActorFile(actor, voice);
        String hash = recordMessage(message, voice, voiceDir);
        // Unused directories will remain because an update changes the
        // checksum of the message
        // TODO clean up by checking unused
        created.add(hash);
    }
}

[Buggy Hunk]
ttsPlayer.textToSpeech.setVoice(voice);

[Patch]
speechSynthesizer.textToSpeech.setVoice(voice);