}
    public long log(String[] targetPaths, long startRevision, long endRevision,            boolean changedPaths, boolean strictNode, long limit,            ISVNLogEntryHandler handler) throws SVNException {        long count = 0;        try {            openConnection();            Object[] buffer = new Object[] { "log",                    getRepositoryPaths(targetPaths),                    getRevisionObject(startRevision),                    getRevisionObject(endRevision),                    Boolean.valueOf(changedPaths), Boolean.valueOf(strictNode),                    limit > 0 ? new Long(limit) : null };            write("(w((*s)(n)(n)wwn))", buffer);            authenticate();            while (true) {                try {                    read("((", buffer);                    Map changedPathsMap = null;                    if (changedPaths) {                        changedPathsMap = handler != null ? new HashMap()                                : null;                        while (true) {                            try {                                read("(SW(?S?N))", buffer);                                if (changedPathsMap != null) {                                    String path = SVNReader                                            .getString(buffer, 0);                                    if (path != null && !"".equals(path.trim())) {                                        String type = SVNReader.getString(                                                buffer, 1);                                        String copyPath = SVNReader.getString(                                                buffer, 2);                                        long copyRev = SVNReader.getLong(                                                buffer, 3);                                        changedPathsMap.put(path,                                                new SVNLogEntryPath(path, type                                                        .charAt(0), copyPath,                                                        copyRev));                                    }                                }                            } catch (SVNException e) {                                break;                            }                        }                    }                    read(")N(?S)(?S)(?S))", buffer);                    count++;                    if (handler != null && (limit == 0 || limit <= count)) {                        long revision = SVNReader.getLong(buffer, 0);                        String author = SVNReader.getString(buffer, 1);                        Date date = SVNReader.getDate(buffer, 2);                        String message = SVNReader.getString(buffer, 3);                        // remove all                        if (!(limit > 0 && count > limit)) {                            handler.handleLogEntry(new SVNLogEntry(                                    changedPathsMap, revision, author, date,                                    message));                        }                    }                } catch (SVNException e) {                    read("x", buffer);                    if (limit <= 0 || (limit > 0 && count <= limit)) {                        read("[()]", buffer);                    }                    return count;                }            }        } finally {            closeConnection();        }    }