[Demonstration 1]

[Buggy Method]
private void onPreparePropose() {
    /*
         * BEGIN Create new NOTIFICATION to notify Switch Owner
         */
    NotificationModel proposeNotificationModel = mNotificationModel;
    //set new accessibility
    HashMap<String, Boolean> user_flag = new HashMap<>();
    user_flag.put(FireBaseTool.FLAG_ACCESS, true);
    user_flag.put(FireBaseTool.FLAG_IS_READ, false);
    //add user flag in user object, key
    HashMap<String, Object> user = new HashMap<>();
    user.put(proposeNotificationModel.getCreated_by(), user_flag);
    //set value for Post_Switch notification type (notification_key5)
    proposeNotificationModel.setAccessibility(user);
    proposeNotificationModel.setCreated_by(Shared.getUserModel(getContext()).getUserId());
    proposeNotificationModel.setFrom_notification_key(proposeNotificationModel.getId());
    proposeNotificationModel.setMessage(getString(R.string.text_propose_switch));
    proposeNotificationModel.setType(FireBaseTool.TYPE_POST_SWITCH);
    proposeNotificationModel.setPropose_duty(mProposeDutyModel.getId());
    proposeNotificationModel.setCreated_date();
    //Create push() key
    final String notificationNewKey = getDatabaseRef().child(FireBaseTool.CHILD_NOTIFICATION_KEY).push().getKey();
    updateDatabase(FireBaseTool.PATH_NOTIFICATION(notificationNewKey), proposeNotificationModel.toMapSwitch());
    findViewById(R.id.btn_propose).setEnabled(false);
    ((Button) findViewById(R.id.btn_propose)).setText(getString(R.string.text_propose_successful));
    /* END*/
}

[Buggy Hunk]
final String notificationNewKey = getDatabaseRef().child(FireBaseTool.CHILD_NOTIFICATION_KEY).push().getKey();

[Patch]
final String notificationNewKey = getDatabaseRef().child(FireBaseTool.CHILD_NOTIFICATION).push().getKey();

[Demonstration 2]

[Buggy Method]
@SuppressWarnings("unchecked")
public static <T> Pair<T, DataStoreEntryInfo> decodeRow(final Result row, final HBaseRowId rowId, final DataAdapter<T> dataAdapter, final AdapterStore adapterStore, final QueryFilter clientFilter, final Index index, final ScanCallback<T> scanCallback) {
    if ((dataAdapter == null) && (adapterStore == null)) {
        LOGGER.error("Could not decode row from iterator. Either adapter or adapter store must be non-null.");
        return null;
    }
    DataAdapter<T> adapter = dataAdapter;
    List<KeyValue> rowMapping;
    try {
        rowMapping = getSortedRowMapping(row);
    } catch (final IOException e) {
        LOGGER.error("Could not decode row from iterator. Ensure whole row iterators are being used.");
        return null;
    }
    // build a persistence encoding object first, pass it through the
    // client filters and if its accepted, use the data adapter to
    // decode the persistence model into the native data type
    final PersistentDataset<CommonIndexValue> indexData = new PersistentDataset<CommonIndexValue>();
    final PersistentDataset<Object> extendedData = new PersistentDataset<Object>();
    // for now we are assuming all entries in a row are of the same type
    // and use the same adapter
    boolean adapterMatchVerified;
    ByteArrayId adapterId;
    if (adapter != null) {
        adapterId = adapter.getAdapterId();
        adapterMatchVerified = false;
    } else {
        adapterMatchVerified = true;
        adapterId = null;
    }
    final List<FieldInfo> fieldInfoList = new ArrayList<FieldInfo>(rowMapping.size());
    for (final KeyValue entry : rowMapping) {
        // the column family is the data element's type ID
        if (adapterId == null) {
            adapterId = new ByteArrayId(entry.getFamily());
            //entry.getKey().getColumnFamilyData().getBackingArray());
        }
        if (adapter == null) {
            adapter = (DataAdapter<T>) adapterStore.getAdapter(adapterId);
            if (adapter == null) {
                LOGGER.error("DataAdapter does not exist");
                return null;
            }
        }
        if (!adapterMatchVerified) {
            if (!adapterId.equals(adapter.getAdapterId())) {
                return null;
            }
            adapterMatchVerified = true;
        }
        final ByteArrayId fieldId = new ByteArrayId(entry.getQualifier());
        //entry.getKey().getColumnQualifierData().getBackingArray());
        final CommonIndexModel indexModel;
        indexModel = index.getIndexModel();
        // first check if this field is part of the index model
        final FieldReader<? extends CommonIndexValue> indexFieldReader = indexModel.getReader(fieldId);
        final byte[] byteValue = entry.getValueArray();
        if (indexFieldReader != null) {
            final CommonIndexValue indexValue = indexFieldReader.readField(byteValue);
            //indexValue.setVisibility(entry.getKey().getColumnVisibilityData().getBackingArray());
            final PersistentValue<CommonIndexValue> val = new PersistentValue<CommonIndexValue>(fieldId, indexValue);
            indexData.addValue(val);
            fieldInfoList.add(getFieldInfo(val, byteValue, indexValue.getVisibility()));
        } else {
            // next check if this field is part of the adapter's
            // extended data model
            final FieldReader<?> extFieldReader = adapter.getReader(fieldId);
            if (extFieldReader == null) {
                // if it still isn't resolved, log an error, and
                // continue
                LOGGER.error("field reader not found for data entry, the value will be ignored");
                continue;
            }
            final Object value = extFieldReader.readField(byteValue);
            final PersistentValue<Object> val = new PersistentValue<Object>(fieldId, value);
            extendedData.addValue(val);
            fieldInfoList.add(getFieldInfo(val, byteValue, null));
            //entry.getKey().getColumnVisibility().getBytes()));
        }
    }
    final IndexedAdapterPersistenceEncoding encodedRow = new IndexedAdapterPersistenceEncoding(adapterId, new ByteArrayId(rowId.getDataId()), new ByteArrayId(rowId.getInsertionId()), rowId.getNumberOfDuplicates(), indexData, extendedData);
    if ((clientFilter == null) || clientFilter.accept(encodedRow)) {
        // cannot get here unless adapter is found (not null)
        if (adapter == null) {
            LOGGER.error("Error, adapter was null when it should not be");
        } else {
            final Pair<T, DataStoreEntryInfo> pair = Pair.of(adapter.decode(encodedRow, index), new DataStoreEntryInfo(Arrays.asList(new ByteArrayId(row.getRow())), // getRowData().getBackingArray())),
            fieldInfoList));
            if (scanCallback != null) {
                scanCallback.entryScanned(pair.getRight(), pair.getLeft());
            }
            return pair;
        }
    }
    return null;
}

[Buggy Hunk]
final byte byteValue[] = entry.getValueArray();

[Patch]
final byte byteValue[] = entry.getValue();

[Demonstration 3]

[Buggy Method]
private <T> void populateConditions(final Map<String, Double> actualVars, final Map<String, Object> program, final RandomGenerator rand, final Incarnation<T> incarnation, final Environment<T> env, final Node<T> node, final TimeDistribution<T> td, final Reaction<T> reaction) {
    final List<?> condList = (List<?>) program.get(CONDITIONS);
    if (condList != null) {
        /*
             * Merge existing conditions and those listed.
             */
        final List<Condition<T>> conditions = Stream.concat(reaction.getConditions().stream(), condList.stream().map(condObj -> makeSupplier(() -> incarnation.createCondition(rand, env, node, td, reaction, stringOrNull(condObj)), castOrEmpty(condObj), CONDITIONS_PACKAGE_ROOT, actualVars, rand, env).get())).collect(Collectors.toList());
        L.trace("conditions: {}", conditions);
        reaction.setConditions(conditions);
    }
}

[Buggy Hunk]
castOrEmpty(condObj), CONDITIONS_PACKAGE_ROOT, actualVars, rand, env)

[Patch]
castOrEmpty(condObj), CONDITIONS_PACKAGE_ROOT, actualVars, rand, env, node, td, reaction)