[Demonstration 1]

[Buggy Method]
public void executeReport() {
    //init ReportProperty first?
    //check if report date is reached
    if (!precondition.isPreconditionReached(reportObject)) {
        logger.info("Report date not reached");
        return;
    }
    //build Report Links
    List<ReportLinkProperty> reportLinks = reportLinkFactory.getReportLinks(reportObject);
    //get the report context
    intervalCalculator.buildIntervals(reportObject);
    contextBuilder.setIntervalCalculator(intervalCalculator);
    Map<String, Object> contextMap = contextBuilder.buildContext(reportLinks);
    //initialize data
    ReportProperty property = new ReportProperty(reportObject);
    Report report = new Report(property, contextMap);
    //write file into report
    finisher.finishReport(report, property);
    if (!isPreconditionReached(reportObject, new SampleHandler())) {
        logger.info("condition not reached");
        return;
    }
    try {
        //set report
        byte[] outputBytes = report.getReportFile();
        String sendReportTimeString = new DateTime().toString(DateTimeFormat.forPattern("dd_MM_yyyy"));
        String reportName = reportObject.getName() + "_" + sendReportTimeString + ".xls";
        JEVisFileImp jeVisFileImp = new JEVisFileImp(reportName, outputBytes);
        JEVisAttribute lastReportAttribute = reportObject.getAttribute(ReportAttributes.LAST_REPORT);
        lastReportAttribute.buildSample(new DateTime(), jeVisFileImp).commit();
        //send notification
        JEVisObject notificationObject = property.getNotificationObject();
        sendNotification(notificationObject, jeVisFileImp);
    } catch (JEVisException ex) {
    } catch (IOException ex) {
        java.util.logging.Logger.getLogger(ReportExecutor.class.getName()).log(Level.SEVERE, null, ex);
    }
}

[Buggy Hunk]
if (!isPreconditionReached(reportObject, new SampleHandler())) {

[Patch]
if (isPeriodicReport(reportObject) && !isPeriodicConditionReached(reportObject, new SampleHandler())) {

[Demonstration 2]

[Buggy Method]
public Integer addMeasurePoint(int tDPower, int tPPower, int cpower, int tGas, DateTime mDateTime) {
    Session session = factory.openSession();
    Transaction tx = null;
    Integer measurePointID = null;
    try {
        tx = session.beginTransaction();
        MeasurePoint measurePoint = new MeasurePoint(tDPower, tPPower, cpower, tGas, mDateTime);
        measurePointID = (Integer) session.save(measurePoint);
        tx.commit();
    } catch (HibernateException e) {
        if (tx != null)
            tx.rollback();
        e.printStackTrace();
    } finally {
        session.close();
    }
    return measurePointID;
}

[Buggy Hunk]
e.printStackTrace();

[Patch]
LOG.error("Failed to addMeasurePoint :" + e);

[Demonstration 3]

[Buggy Method]
@Override
public String getSubtitle() {
    return object.getMetaDataSet().get(MetaData.FILE_NAME).getStringValue();
}

[Buggy Hunk]
return object.getMetaDataSet().get(MetaData.FILE_NAME).getStringValue();

[Patch]
return taggable().getMetaDataSet().get(MetaData.FILE_NAME).getStringValue();