[Demonstration 1]

[Buggy Method]
@SuppressWarnings("unchecked")
@Override
protected Response<BaseBean> parseNetworkResponse(NetworkResponse response) {
    try {
        BaseBean bean = null;
        if (response.data != null) {
            long time = HttpHeaderParser.getHeaderDate(response.headers);
            if (time != 0) {
                DateUtil.setWenbaTime(time);
            }
            String responseString = new String(response.data, HttpHeaderParser.parseCharset(response.headers));
            BBLog.i(TAG, "before dec->" + getUrl() + ":" + responseString);
            if (responseString != null && !"".equals(responseString)) {
                bean = (BaseBean) JsonToBeanHandler.getInstance().fromJsonString(responseString, clas);
            }
            Context context = YouXinApplication.getInstance();
            if (bean != null && (bean.getStatus() == 2 || bean.getStatus() == 20)) {
                if (context != null) {
                }
            }
        }
        return Response.success(bean, HttpHeaderParser.parseCacheHeaders(response));
    } catch (JsonParseException e) {
        e.printStackTrace();
        return Response.error(new ParseError(APPUtil.getString(R.string.error_response_data)));
    } catch (OutOfMemoryError e) {
        e.printStackTrace();
        return Response.error(new ParseError(APPUtil.getString(R.string.error_wenba)));
    } catch (Exception e) {
        e.printStackTrace();
        return Response.error(new ParseError(APPUtil.getString(R.string.error_wenba)));
    }
}

[Buggy Hunk]
BBLog.i(TAG, "before dec->" + getUrl() + ":" + responseString);

[Patch]
BBLog.e(TAG, getUrl() + ":" + responseString);

[Demonstration 2]

[Buggy Method]
public void searchLastAvailableInputPointDate(ExchangeRate rate, Configuration configuration) {
    for (TimeSeriesGroup subGoup : subGroups) {
        subGoup.searchLastAvailableInputPointDate(rate, configuration);
    }
    if (isRoot())
        return;
    if (!rate.getUUID().equals(referencedRateUUID)) {
        logger.info("Error: createInputValueLists, the wrong rate is used! Expected is " + referencedRateUUID + "for group " + this.getFullName());
        return;
    }
    //Rate Series
    if (this.name.equals(GROUP_RATE)) {
        if (configuration.getPeriod() == PeriodType.DAY) {
            LinkedList<HistoricalPoint> hisPointList = rate.getHistoricalData().getNoneEmptyPoints();
            for (TimeSeries series : this.timeSeriesList) {
                int nbOfValues = series.getNumberOfPastValues();
                configuration.setLastInputPointDate(hisPointList.get(nbOfValues - 1).getDate());
            }
        }
    } else //Financial series
    if (this.name.equals(GROUP_FINANCIAL) && rate instanceof Stock) {
        Stock stock = (Stock) rate;
        LinkedList<Calendar> financialsDates = stock.getFinancials().getDateList(FinancialPoint.PeriodeTypeQuaterly);
        for (TimeSeries series : this.timeSeriesList) {
            int nbOfValues = series.getNumberOfPastValues();
            Calendar date = financialsDates.get(financialsDates.size() - nbOfValues - 1);
            //stock.getFinancials().getEffectiveDate(FinancialPoint.PeriodeTypeQuaterly, date)
            configuration.setLastInputPointDate(stock.getFinancials().getEffectiveDate(FinancialPoint.PeriodeTypeQuaterly, date));
        }
    } else //Target Output
    if (this.name.equals(GROUP_TARGET_OUTPUT) && configuration.getOutputPointList() != null && configuration.getOutputPointList().isEmpty()) {
        for (TimeSeries series : this.timeSeriesList) {
            int nbOfValues = series.getNumberOfPastValues();
            configuration.setLastInputPointDate(configuration.getOutputPointList().get(nbOfValues).getDate());
        }
        //Last output point
        configuration.setLastInputPointDate(configuration.getOutputPointList().getFirst().getDate());
    } else //Indicators
    if (this.name.equals(GROUP_INDICATOR)) {
        //logger.info("Please implements this section! searchLastAvailableInputPointDate");
        for (TimeSeries series : this.timeSeriesList) {
            int nbOfValues = series.getNumberOfPastValues();
            if (series.getIndicator() == null)
                continue;
            if (configuration.getPeriod() == PeriodType.DAY) {
                LinkedList<HistoricalPoint> hisPointList = rate.getHistoricalData().getNoneEmptyPoints();
                series.getIndicator().compute(rate.getHistoricalData());
                int total = nbOfValues + series.getIndicator().getMainChartSerie().getValidAtPosition();
                configuration.setLastInputPointDate(hisPointList.get(total - 1).getDate());
                logger.info(GROUP_INDICATOR + ", Last input point Date: " + DateTool.dateToDayString(configuration.getLastInputPointDate()));
            }
        }
    }
}

[Buggy Hunk]
configuration.getOutputPointList().isEmpty()){

[Patch]
!configuration.getOutputPointList().isEmpty()){

[Demonstration 3]

[Buggy Method]
private String downloadInfoForOntology(String address, File destFile, OntologyMetaData metaData, String infoType) throws ResourceAccessDeniedException, ResourceNotFoundException, ResourceDownloadException, ParseException, IOException {
    if (destFile.exists() && destFile.length() > 0) {
        log.info("The file {} exists and is not empty. It is kept, download of the file is skipped.", destFile);
        return IOUtils.toString(BioPortalToolUtils.getInputStreamFromFile(destFile));
    }
    try {
        log.debug("Fetching {} from BioPortal for {}", infoType, metaData.acronym);
        HttpEntity propertiesResponse = httpHandler.sendGetRequest(address);
        String infoString = EntityUtils.toString(propertiesResponse);
        try (Writer w = BioPortalToolUtils.getWriterToFile(destFile)) {
            w.write(infoString);
        }
        return infoString;
    } catch (ResourceDownloadException e) {
        log.error("Error occured when trying to retrieve latest " + infoType + " of ontology " + metaData.acronym + ":", e);
        throw e;
    }
}

[Buggy Hunk]
return IOUtils.toString(BioPortalToolUtils.getInputStreamFromFile(destFile));

[Patch]
return IOUtils.toString(BioPortalToolUtils.getInputStreamFromFile(destFile), Charset.forName("UTF-8"));