[Demonstration 1]

[Buggy Method]
private Customer retrieveCustomerFromResultSet(ResultSet results) throws SQLException {
    Customer customer = new Customer();
    while (results.next()) {
        customer.setCustomerId(results.getInt("customer_id"));
        customer.setFirstName(results.getString("first_name"));
        customer.setLastName(results.getString("last_name"));
        customer.setEmail(results.getString("email"));
        customer.setPassword(results.getString("password"));
    }
    return customer;
}

[Buggy Hunk]
customer.setEmail(results.getString("email"));

[Patch]
customer.setEmailAddress(results.getString("email_address"));

[Demonstration 2]

[Buggy Method]
private void deleteInternal(LockedInodePath inodePath, boolean recursive, boolean replayed, long opTimeMs) throws FileDoesNotExistException, IOException, DirectoryNotEmptyException, InvalidPathException {
    // TODO(jiri): A crash after any UFS object is deleted and before the delete operation is
    // journaled will result in an inconsistency between Alluxio and UFS.
    if (!inodePath.fullPathExists()) {
        return;
    }
    Inode<?> inode = inodePath.getInode();
    if (inode == null) {
        return;
    }
    if (inode.isDirectory() && !recursive && ((InodeDirectory) inode).getNumberOfChildren() > 0) {
        // inode is nonempty, and we don't want to delete a nonempty directory unless recursive is
        // true
        throw new DirectoryNotEmptyException(ExceptionMessage.DELETE_NONEMPTY_DIRECTORY_NONRECURSIVE, inode.getName());
    }
    if (mInodeTree.isRootId(inode.getId())) {
        // The root cannot be deleted.
        throw new InvalidPathException(ExceptionMessage.DELETE_ROOT_DIRECTORY.getMessage());
    }
    List<Inode<?>> delInodes = new ArrayList<>();
    delInodes.add(inode);
    try (InodeLockList lockList = mInodeTree.lockDescendants(inodePath, InodeTree.LockMode.WRITE)) {
        delInodes.addAll(lockList.getInodes());
        TempInodePathForDescendant tempInodePath = new TempInodePathForDescendant(inodePath);
        // We go through each inode, removing it from its parent set and from mDelInodes. If it's a
        // file, we deal with the checkpoints and blocks as well.
        for (int i = delInodes.size() - 1; i >= 0; i--) {
            Inode<?> delInode = delInodes.get(i);
            // the path to delInode for getPath should already be locked.
            AlluxioURI alluxioUriToDel = mInodeTree.getPath(delInode);
            tempInodePath.setDescendant(delInode, alluxioUriToDel);
            // TODO(jiri): What should the Alluxio behavior be when a UFS delete operation fails?
            // Currently, it will result in an inconsistency between Alluxio and UFS.
            if (!replayed && delInode.isPersisted()) {
                try {
                    // If this is a mount point, we have deleted all the children and can unmount it
                    // TODO(calvin): Add tests (ALLUXIO-1831)
                    if (mMountTable.isMountPoint(alluxioUriToDel)) {
                        //comment(Jason): in our case, mount table should not be delete always
                        unmountInternal(alluxioUriToDel);
                    } else {
                        // Delete the file in the under file system.
                        MountTable.Resolution resolution = mMountTable.resolve(alluxioUriToDel);
                        String ufsUri = resolution.getUri().toString();
                        UnderFileSystem ufs = resolution.getUfs();
                        boolean failedToDelete = false;
                        if (delInode.isFile()) {
                            if (!ufs.deleteFile(ufsUri)) {
                                failedToDelete = ufs.isFile(ufsUri);
                                if (!failedToDelete) {
                                    LOG.warn("The file to delete does not exist in ufs: {}", ufsUri);
                                }
                            }
                        } else {
                            if (!ufs.deleteDirectory(ufsUri, DeleteOptions.defaults().setRecursive(true))) {
                                failedToDelete = ufs.isDirectory(ufsUri);
                                if (!failedToDelete) {
                                    LOG.warn("The directory to delete does not exist in ufs: {}", ufsUri);
                                }
                            }
                        }
                        if (failedToDelete) {
                            LOG.error("Failed to delete {} from the under filesystem", ufsUri);
                            throw new IOException(ExceptionMessage.DELETE_FAILED_UFS.getMessage(ufsUri));
                        }
                    }
                } catch (InvalidPathException e) {
                    LOG.warn(e.getMessage());
                }
            }
            if (delInode.isFile()) {
                // Remove corresponding blocks from workers and delete metadata in master.
                mBlockMaster.removeBlocks(((InodeFile) delInode).getBlockIds(), true);
            }
            mInodeTree.deleteInode(tempInodePath, opTimeMs);
        }
    }
    Metrics.PATHS_DELETED.inc(delInodes.size());
}

[Buggy Hunk]
if (!replayed && delInode.isPersisted()) {

[Patch]
if (!replayed && delInode.isPersisted() && LOAD_METADATA_FROM_UFS_ENABLED) {

[Demonstration 3]

[Buggy Method]
public User toUser() {
    User user = new User();
    user.setEmail(email);
    user.setLogin(login);
    user.setPassword(new BCryptPasswordEncoder().encode(password));
    user.setRole(role);
    user.setEnabled(true);
    user.setName(name);
    user.setName(surname);
    return user;
}

[Buggy Hunk]
user.setName(surname);

[Patch]
user.setSurname(surname);