[Demonstration 1]

[Buggy Method]
protected void dispose(ArtifactId aid) throws OperationException {
    try {
        env.disposeArtifact(this.getCurrentOpAgentId(), id);
    } catch (Exception ex) {
        throw new OperationException("disposeArtifact failed: " + aid);
    }
}

[Buggy Hunk]
env.disposeArtifact(this.getCurrentOpAgentId(),id);

[Patch]
env.disposeArtifact(this.getCurrentOpAgentId(),aid);

[Demonstration 2]

[Buggy Method]
private void validateJNDIRefs(String jndiName, JndiNameEnvironment env, JNDINamespace namespace) {
    if (jndiName == null) {
        deplLogger.log(Level.SEVERE, RESOURCE_REF_JNDI_LOOKUP_FAILED, new Object[] { null });
        throw new DeploymentException("Null JNDI resource");
    }
    if (!isResourceInDomainXML(jndiName) && !isDefaultResource(jndiName)) {
        // convert comp to module if req
        String convertedJndiName = getLogicalJNDIName(jndiName, env);
        if (!namespace.find(convertedJndiName, env)) {
            // Do a context lookup only if we are on the correct instance - Cluster case
            try {
                if (loadOnCurrentInstance()) {
                    InitialContext ctx = new InitialContext();
                    ctx.lookup(jndiName);
                }
            } catch (NamingException e) {
                deplLogger.log(Level.SEVERE, RESOURCE_REF_JNDI_LOOKUP_FAILED, new Object[] { jndiName });
                DeploymentException de = new DeploymentException(String.format("JNDI resource not present: %s", jndiName));
                de.initCause(e);
                throw de;
            }
        }
    }
}

[Buggy Hunk]
if (jndiName == null) {

[Patch]
if (jndiName == null || "".equals(jndiName)) {

[Demonstration 3]

[Buggy Method]
@Override
public void delete(String boardID) {
    Transaction tx = null;
    Session session = null;
    try {
        session = HibernateUtil.getInstance().getCurrentSession();
        tx = session.beginTransaction();
        PersistentBoard pBoard = (PersistentBoard) session.get(PersistentBoard.class, boardID);
        for (PersistentPiece p : pBoard.getPieces()) {
            session.delete(p);
        }
        session.delete(pBoard);
        tx.commit();
    } catch (HibernateException ex) {
        if (tx != null)
            tx.rollback();
        throw new RuntimeException(ex.getMessage());
    }
}

[Buggy Hunk]
throw new RuntimeException(ex.getMessage());

[Patch]
ex.printStackTrace();