[Demonstration 1]

[Buggy Method]
@SuppressWarnings("unchecked")
public static <T> T createObject(AdapterBase adapter, ObjectRowMap cache, HashMap<String, Object> map, Class<T> resultClass, ConnectionWrapper cw, String tableName, Long dbId) throws SQLException {
    try {
        if (ObjectTools.isDatabasePrimitive(resultClass)) {
            if (resultClass.isAssignableFrom(Number.class)) {
                //safe cast of numbers
                return (T) ObjectTools.cast(resultClass, (Number) map.get(Defaults.VALUE_COL));
            } else {
                return resultClass.cast(map.get(Defaults.VALUE_COL));
            }
        } else {
            // create a new object using the default constructor.
            Constructor<T> constructor = resultClass.getDeclaredConstructor();
            boolean wasAccessible = constructor.isAccessible();
            if (!wasAccessible) {
                //if the constructor is private, make it accessible
                constructor.setAccessible(true);
            }
            T res = constructor.newInstance();
            if (!wasAccessible) {
                constructor.setAccessible(wasAccessible);
            }
            // add object to cache
            cache.storeObject(tableName, res, dbId);
            fillObjectValues(adapter, cache, res, resultClass, map, cw);
            return res;
        }
    } catch (Exception e) {
        throw new SQLException(e);
    }
}

[Buggy Hunk]
if(resultClass.isAssignableFrom(Number.class))

[Patch]
if(Number.class.isAssignableFrom(resultClass))

[Demonstration 2]

[Buggy Method]
public boolean containsIntentID(final String search) {
    try {
        for (VtnFlowCondition fc : readFlowConditions()) {
            String lclfc = fc.getName().getValue();
            String intentID = lclfc.split("_")[0];
            if (intentID.equals(search)) {
                return true;
            }
        }
    } catch (Exception e) {
        LOG.error("Unable to get flow condition name {}", e);
    }
    return false;
}

[Buggy Hunk]
LOG.error("Unable to get flow condition name {}", e);

[Patch]
LOG.error(FLOW_COND_ER_MESSAGE, e);

[Demonstration 3]

[Buggy Method]
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    MedicalRecordItem item = (MedicalRecordItem) adapter.getItem(position);
    DialogFragment informationDialog = item.getInformation();
    if (informationDialog != null) {
        Bundle bundle = new Bundle();
        bundle.putSerializable("item", item);
        informationDialog.setArguments(bundle);
        informationDialog.show(getFragmentManager(), "MedicalRecordItemInformation");
    }
}

[Buggy Hunk]
DialogFragment informationDialog = item.getInformation();

[Patch]
DialogFragment informationDialog = item.acceptInformation();