[Demonstration 1]

[Buggy Method]
public Plant couch(int pos) {
    try {
        if (Dungeon.visible[pos]) {
            Sample.INSTANCE.play(Assets.SND_PLANT);
        }
        Plant plant = plantClass.newInstance();
        plant.pos = pos;
        return plant;
    } catch (Exception e) {
        ShatteredPixelDungeon.reportException(e);
        return null;
    }
}

[Buggy Hunk]
if (Dungeon.visible[pos]) {

[Patch]
if (Dungeon.visible != null && Dungeon.visible[pos]) {

[Demonstration 2]

[Buggy Method]
public void incrementLexiconSufficientStatistics(SufficientStatistics gradient, SufficientStatistics parameters, CcgParse parse, double count) {
    List<SufficientStatistics> lexiconGradientList = gradient.coerceToList().getStatisticByName(LEXICON_PARAMETERS).coerceToList().getStatistics();
    List<SufficientStatistics> lexiconParameterList = parameters.coerceToList().getStatisticByName(LEXICON_PARAMETERS).coerceToList().getStatistics();
    List<SufficientStatistics> lexiconScorerGradientList = gradient.coerceToList().getStatisticByName(LEXICON_SCORER_PARAMETERS).coerceToList().getStatistics();
    List<SufficientStatistics> lexiconScorerParameterList = parameters.coerceToList().getStatisticByName(LEXICON_SCORER_PARAMETERS).coerceToList().getStatistics();
    List<String> sentenceOriginalWords = parse.getSpannedWords();
    List<String> sentencePreprocessedWords = parse.getLexiconTriggerWords();
    List<String> sentencePosTags = parse.getPosTags();
    List<LexiconEntry> lexiconEntries = parse.getSpannedLexiconEntries();
    List<Integer> lexiconEntryIndexes = parse.getSpannedLexiconEntryIndexes();
    List<List<String>> posTags = parse.getSpannedPosTagsByLexiconEntry();
    Preconditions.checkArgument(lexiconEntries.size() == posTags.size());
    int numEntries = lexiconEntries.size();
    int numTokensProcessed = 0;
    for (int i = 0; i < numEntries; i++) {
        LexiconEntry lexiconEntry = lexiconEntries.get(i);
        int lexiconIndex = lexiconEntryIndexes.get(i);
        int spanStart = numTokensProcessed;
        int spanEnd = numTokensProcessed + posTags.get(i).size() - 1;
        numTokensProcessed += posTags.get(i).size();
        lexiconFamilies.get(lexiconIndex).incrementLexiconSufficientStatistics(lexiconGradientList.get(lexiconIndex), lexiconParameterList.get(lexiconIndex), lexiconEntry.getWords(), posTags.get(i), lexiconEntry.getCategory(), count);
        for (int j = 0; j < lexiconScorerFamilies.size(); j++) {
            lexiconScorerFamilies.get(j).incrementLexiconSufficientStatistics(lexiconScorerGradientList.get(j), lexiconScorerParameterList.get(j), spanStart, spanEnd, sentenceOriginalWords, sentencePreprocessedWords, sentencePosTags, lexiconEntry.getWords(), posTags.get(i), lexiconEntry.getCategory(), count);
        }
    }
}

[Buggy Hunk]
List<String> sentencePosTags = parse.getPosTags();

[Patch]
List<String> sentencePosTags = parse.getSpannedPosTags();

[Demonstration 3]

[Buggy Method]
private int positionToCell(final Position pos) {
    return (pos.getColumn() * 3) + pos.getRow();
}

[Buggy Hunk]
return (pos.getColumn() * 3) + pos.getRow();

[Patch]
return (pos.getRow() * 3) + pos.getColumn();