[Demonstration 1]

[Buggy Method]
@Transactional(readOnly = true)
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    try {
        Account account = accountSharedService.findOne(username);
        boolean passwordExpired = false;
        boolean initialPassword = false;
        DateTime lastPasswordChangeDate = account.getLastPasswordChangeDate();
        if (lastPasswordChangeDate == null) {
            initialPassword = true;
        } else {
            DateTime passwordExpiredDate = lastPasswordChangeDate.plusMinutes(1);
            passwordExpired = dateFactory.newDateTime().isAfter(passwordExpiredDate);
        }
        return new SampleUserDetails(account, passwordExpired, initialPassword, accountSharedService.isLocked(username));
    } catch (Exception e) {
        throw new UsernameNotFoundException("user not found", e);
    }
}

[Buggy Hunk]
} catch (Exception e) {

[Patch]
} catch (ResourceNotFoundException e) {

[Demonstration 2]

[Buggy Method]
public void changeConf(List<String> props, List<String> newVals) throws IOException {
    for (int i = 0; i < props.size(); i++) {
        String prop = props.get(i);
        String value = newVals.get(i);
        if (prop.equals(DFSConfigKeys.DFS_RESOLVING_CACHE_ENABLED) || prop.equals(DFSConfigKeys.DFS_SET_PARTITION_KEY_ENABLED)) {
            LOG.info("change configuration for  " + prop + " to " + value);
            conf.set(prop, value);
            if (prop.equals(DFSConfigKeys.DFS_RESOLVING_CACHE_ENABLED)) {
                Cache.getInstance().enableOrDisable(Boolean.parseBoolean(value));
            }
        } else {
            LOG.info("change configuration for  " + prop + " to " + value + " is not supported yet");
        }
    }
}

[Buggy Hunk]
public void changeConf(List<String> props, List<String> newVals)

[Patch]
void changeConf(List<String> props, List<String> newVals)

[Demonstration 3]

[Buggy Method]
private static Schema getComplexAvroFieldSchema(HCatFieldSchema fieldSchema) throws HCatException {
    Schema schema = null;
    switch(fieldSchema.getCategory()) {
        case MAP:
            {
                HCatFieldSchema valueSchema = fieldSchema.getMapValueSchema().get(0);
                Category valueCategory = valueSchema.getCategory();
                if (valueCategory == Category.PRIMITIVE) {
                    Schema subType = getPrimitiveAvroField(valueSchema);
                    schema = Schema.createMap(subType);
                } else {
                    schema = getComplexAvroFieldSchema(valueSchema);
                }
            }
            break;
        case ARRAY:
            {
                HCatFieldSchema valueSchema = fieldSchema.getArrayElementSchema().get(0);
                Category valueCategory = valueSchema.getCategory();
                if (valueCategory == Category.PRIMITIVE) {
                    Schema subType = getPrimitiveAvroField(valueSchema);
                    schema = Schema.createArray(subType);
                } else {
                    schema = getComplexAvroFieldSchema(valueSchema);
                }
            }
            break;
        case STRUCT:
            {
                HCatSchema valueSchema = fieldSchema.getStructSubSchema();
                schema = getRecordAvroFieldSchema(valueSchema, fieldSchema.getName());
            }
            break;
        default:
            throw new IllegalArgumentException("invalid type");
    }
    return Schema.createUnion(ImmutableList.of(schema, nullSchema));
}

[Buggy Hunk]
return Schema.createUnion(ImmutableList.of(schema, nullSchema));

[Patch]
return schema; //Schema.createUnion(ImmutableList.of(schema, nullSchema));