[Demonstration 1]

[Buggy Method]
public void crearMatrizPositivaNegativa(Map<String, String> idsMap) {
    replaceBrokenArcIds(idsMap);
    this.positiva = new int[this.plazas.size()][this.transiciones.size()];
    this.negativa = new int[this.plazas.size()][this.transiciones.size()];
    this.marcadoInicial = new int[this.plazas.size()];
    //Pone a cero todos los valores de los arreglos
    for (int f = 0; f < this.plazas.size(); f = f + 1) {
        for (int c = 0; c < this.transiciones.size(); c = c + 1) {
            this.positiva[f][c] = 0;
            this.negativa[f][c] = 0;
        }
        this.marcadoInicial[f] = 0;
    }
    //En primer lugar, completamos el marcado inicial
    for (Entry<String, Plaza> plazaEntry : this.plazas.entrySet()) {
        //Guarda el marcado en el vector marcadoInicial, en la posicion
        //indicada por numero de Plaza/fila en matriz.
        this.marcadoInicial[plazaEntry.getValue().getPosicionFilaMatriz()] = plazaEntry.getValue().getMarcadoPlaza();
    }
    //Luego se completan la matriz de incidencia positiva y negativa
    for (Entry<String, ElementoArco> arcosValue : this.arcos.entrySet()) {
        // si es un brazo inhibidor no debo incluirlo en estas matrices, ya que tendra su propia matriz.
        if (arcosValue.getValue().isInhibitor())
            continue;
        //Se determina si el peso del arco debe ir
        //en la matriz positiva en caso que el idSource coincida con una transicion
        //o en la matriz negativa, si el idSource coincide con una plaza.
        int peso = arcosValue.getValue().getValorElemento().intValue();
        //Si existe en transiciones una key con
        //el valor de idSource, implica que el peso
        //debe ir en la matriz positiva.
        if (this.transiciones.containsKey(arcosValue.getValue().getSource())) {
            int posicionTarget = this.plazas.get(arcosValue.getValue().getTarget()).getPosicionFilaMatriz();
            int posicionSource = this.transiciones.get(arcosValue.getValue().getSource());
            //FILA = numero de Plaza de la plaza indicada por el idTarget del arco actual.
            //COLUMNA = numero de transicion de la transicion indicada por el idSource del arco atual.
            //Se carga la posicion de la matriz de incidencia positiva.
            this.positiva[posicionTarget][posicionSource] = peso;
        } else //Si existe en plazas una key con el valor de idSource,
        //implica que el peso debe ir en la matriz negativa.
        if (this.plazas.containsKey(arcosValue.getValue().getSource())) {
            int posicionTarget = this.plazas.get(arcosValue.getValue().getSource()).getPosicionFilaMatriz();
            int posicionSource = this.transiciones.get(arcosValue.getValue().getTarget());
            //FILA = numero de Plaza de la plaza indicada por el idSource del arco actual.
            //COLUMNA = numero de transicion de la transicion indicada por el idTarget del arco atual
            //Se carga la posicion de la matriz de incidencia negativa.
            this.negativa[posicionSource][posicionTarget] = peso;
        } else {
            System.out.println("no se encontro idSource: " + arcosValue.getValue().getSource() + ", del arco: " + arcosValue.getKey());
        }
    }
}

[Buggy Hunk]
this.negativa[posicionSource][posicionTarget] = peso;

[Patch]
this.negativa[posicionTarget][posicionSource] = peso;

[Demonstration 2]

[Buggy Method]
@Override
public BufferedImage getPicture(MagicCard mc, MagicEdition ed) throws Exception {
    MagicEdition selected = ed;
    if (ed == null)
        selected = mc.getEditions().get(0);
    if (selected.getId().startsWith("p"))
        return new MagicCardInfoPicturesProvider().getPicture(mc, selected);
    return getPicture(selected.getMultiverse_id());
}

[Buggy Hunk]
if(selected.getId().startsWith("p"))

[Patch]
if(selected.getId().startsWith("p") || selected.getId().equals("CEI")|| selected.getId().equals("CED"))

[Demonstration 3]

[Buggy Method]
public static Result service(String ownerName, String projectName, String service, boolean isAdvertise) throws IOException, UnsupportedOperationException, ServletException {
    if (!isSupportedService(service)) {
        return forbidden(String.format("Unsupported service: '%s'", service));
    }
    Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
    if (project == null) {
        return notFound();
    }
    models.User user = UserApp.currentUser();
    if (!isAllowed(project, service)) {
        if (user.isAnonymous()) {
            return BasicAuthAction.unauthorized(response());
        } else {
            // If you want the Git client showing your custom message to
            // the user, the Content-Type should be exact "text/plain"
            // without any parameter. For more details, see the code at
            // https://github.com/git/git/commit/426e70d4a11ce3b4f70636d57c6a0ab16ae08a00#diff-eea0ad565ec5903a11b6023755d491cfR154
            response().setHeader("Content-Type", "text/plain");
            return forbidden(String.format("'%s' has no permission to '%s/%s'.", user.name, ownerName, projectName));
        }
    }
    if (isAdvertise) {
        return ok(RepositoryService.gitAdvertise(project, service, response()));
    } else {
        if (request().body().isMaxSizeExceeded()) {
            return status(REQUEST_ENTITY_TOO_LARGE);
        } else {
            user.visits(project);
            return ok(RepositoryService.gitRpc(project, service, request(), response()));
        }
    }
}

[Buggy Hunk]
user.name, ownerName, projectName));

[Patch]
user.loginId, ownerName, projectName));