[Demonstration 1]

[Buggy Method]
private StatementClient addFilter(String key, String value) {
    try {
        StatementClient client = new StatementClient(this._host, this.username, this.password);
        if (client.filters == null) {
            client.filters = new TreeMap<String, String>();
        }
        if (this.filters != null) {
            for (Entry<String, String> filter : filters.entrySet()) {
                client.filters.put(filter.getKey(), filter.getValue());
            }
        }
        client.filters.put(key, value);
        return client;
    } catch (MalformedURLException ex) {
        return null;
    }
}

[Buggy Hunk]
this.username, this.password);

[Patch]
this.username, this.adapter, this.password);

[Demonstration 2]

[Buggy Method]
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.name);
    dest.writeString(this.location);
    dest.writeString(this.organizerName);
    dest.writeInt(this.category == null ? -1 : this.category.ordinal());
    dest.writeString(this.description);
    dest.writeInt(this.id);
    dest.writeLong(this.date != null ? this.date.getTime() : -1);
    dest.writeByte(this.showAsStarred ? (byte) 1 : (byte) 0);
}

[Buggy Hunk]
dest.writeByte(this.showAsStarred ? (byte) 1 : (byte) 0);

[Patch]
dest.writeByte(this.isStarred ? (byte) 1 : (byte) 0);

[Demonstration 3]

[Buggy Method]
@Override
public DimensionColumnDataChunk readDimensionChunk(FileHolder fileReader, int blockIndex) {
    byte[] dataPage = null;
    int[] invertedIndexes = null;
    int[] invertedIndexesReverse = null;
    int[] rlePage = null;
    // first read the data and uncompressed it
    dataPage = COMPRESSOR.unCompress(fileReader.readByteArray(filePath, dimensionColumnChunk.get(blockIndex).getDataPageOffset(), dimensionColumnChunk.get(blockIndex).getDataPageLength()));
    // if row id block is present then read the row id chunk and uncompress it
    if (dimensionColumnChunk.get(blockIndex).hasEncoding(Encoding.INVERTED_INDEX)) {
        invertedIndexes = CarbonUtil.getUnCompressColumnIndex(dimensionColumnChunk.get(blockIndex).getRowIdPageLength(), fileReader.readByteArray(filePath, dimensionColumnChunk.get(blockIndex).getRowIdPageOffset(), dimensionColumnChunk.get(blockIndex).getRowIdPageLength()), numberComressor);
        // get the reverse index
        invertedIndexesReverse = getInvertedReverseIndex(invertedIndexes);
    }
    // if rle is applied then read the rle block chunk and then uncompress
    //then actual data based on rle block
    if (dimensionColumnChunk.get(blockIndex).hasEncoding(Encoding.RLE)) {
        // read and uncompress the rle block
        rlePage = numberComressor.unCompress(fileReader.readByteArray(filePath, dimensionColumnChunk.get(blockIndex).getRlePageOffset(), dimensionColumnChunk.get(blockIndex).getRlePageLength()));
        // uncompress the data with rle indexes
        // dataPage = UnBlockIndexer
        // .uncompressData(dataPage, rlePage, eachColumnValueSize[blockIndex]);
        // rlePage = null;`
    }
    // fill chunk attributes
    DimensionChunkAttributes chunkAttributes = new DimensionChunkAttributes();
    chunkAttributes.setEachRowSize(eachColumnValueSize[blockIndex]);
    chunkAttributes.setInvertedIndexes(invertedIndexes);
    chunkAttributes.setInvertedIndexesReverse(invertedIndexesReverse);
    chunkAttributes.setRle(rlePage.length > 0 ? rlePage : null);
    DimensionColumnDataChunk columnDataChunk = null;
    if (dimensionColumnChunk.get(blockIndex).isRowChunk()) {
        // to store fixed length column chunk values
        columnDataChunk = new ColumnGroupDimensionDataChunk(dataPage, chunkAttributes);
    }
    // if no dictionary column then first create a no dictionary column chunk
    // and set to data chunk instance
    if (!dimensionColumnChunk.get(blockIndex).hasEncoding(Encoding.DICTIONARY)) {
        columnDataChunk = new VariableLengthDimensionDataChunk(getNoDictionaryDataChunk(dataPage), chunkAttributes);
        chunkAttributes.setNoDictionary(true);
    } else {
        // to store fixed length column chunk values
        columnDataChunk = new FixedLengthDimensionDataChunk(dataPage, chunkAttributes);
    }
    return columnDataChunk;
}

[Buggy Hunk]
chunkAttributes.setRle(rlePage.length > 0 ? rlePage : null);

[Patch]
chunkAttributes.setRle((rlePage != null && rlePage.length > 0) ? rlePage : null);