[Demonstration 1]

[Buggy Method]
private Object[] buildArguments(Map<String, ?> bag, Type[] types, String[] names, boolean callEvenIfNoArgs) throws Exception {
    assert names.length == types.length;
    Object[] args = new Object[names.length];
    boolean hasArg = callEvenIfNoArgs;
    for (int i = 0; i < args.length; i++) {
        String name = names[i];
        hasArg |= bag.containsKey(name);
        Object a = bag.get(name);
        Type type = types[i];
        if (a != null) {
            args[i] = coerce(this.type.getName() + "." + name, type, a);
        } else if (type instanceof Class && ((Class) type).isPrimitive()) {
            args[i] = ReflectionUtils.getVmDefaultValueForPrimitiveType((Class) type);
            if (args[i] == null && callEvenIfNoArgs)
                throw new UnsupportedOperationException("not yet handling @DataBoundConstructor default value of " + type + "; pass an explicit value for " + name);
        } else {
            // TODO this might be fine (ExecutorStep.label), or not (GenericSCMStep.scm); should inspect parameter annotations for @Nonnull and throw an UOE if found
        }
    }
    return hasArg ? args : null;
}

[Buggy Hunk]
args[i] = ReflectionUtils.getVmDefaultValueForPrimitiveType((Class)type);

[Patch]
args[i] = getVmDefaultValueForPrimitiveType((Class)type);

[Demonstration 2]

[Buggy Method]
@Override
public final E next() {
    if (!found) {
        throw new NoSuchElementException("Either iterator is empty, or iterator state has not " + "been updated");
    }
    if (foundItem == null) {
        throw new IllegalStateException("Potential out of sync error in " + getClass().getSimpleName());
    }
    found = false;
    return foundItem;
}

[Buggy Hunk]
getClass().getSimpleName());

[Patch]
getClass().getName());

[Demonstration 3]

[Buggy Method]
public static PublicKey loadPublicKey(String stored) throws GeneralSecurityException {
    byte[] data = Base64.decode(stored, Base64.NO_WRAP);
    X509EncodedKeySpec spec = new X509EncodedKeySpec(data);
    KeyFactory fact = KeyFactory.getInstance("DH");
    return fact.generatePublic(spec);
}

[Buggy Hunk]
public static PublicKey loadPublicKey(String stored) throws GeneralSecurityException {

[Patch]
public static PublicKey loadPublicKey(String stored) throws GeneralSecurityException, IllegalArgumentException {