if (url != null && path != null) { getDebugLog().info("possibly, not valid getLocations call:"); }
    protected SVNRepositoryLocation[] getLocations(SVNURL url, File path, SVNRepository repository, SVNRevision revision, SVNRevision start, SVNRevision end) throws SVNException {        if (!revision.isValid() || !start.isValid()) {            SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION));        }        long pegRevisionNumber = -1;        long startRevisionNumber;        long endRevisionNumber;        if (url != null && path != null) {            getDebugLog().info("possibly, not valid getLocations call:");        }                if (path != null) {            SVNWCAccess wcAccess = SVNWCAccess.newInstance(null);            try {                wcAccess.openAnchor(path, false, 0);                SVNEntry entry = wcAccess.getEntry(path, false);                if (entry.getCopyFromURL() != null && revision == SVNRevision.WORKING) {                    url = entry.getCopyFromSVNURL();                    pegRevisionNumber = entry.getCopyFromRevision();                } else if (entry.getURL() != null){                    url = entry.getSVNURL();                } else {                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_MISSING_URL, "''{0}'' has no URL", path);                    SVNErrorManager.error(err);                }            } finally {                wcAccess.close();            }        }        if (repository == null) {            repository = createRepository(url, true);        }        if (pegRevisionNumber < 0) {            pegRevisionNumber = getRevisionNumber(revision, repository, path);        }        if (revision == start && revision == SVNRevision.HEAD) {            startRevisionNumber = pegRevisionNumber;        } else {            startRevisionNumber = getRevisionNumber(start, repository, path);        }        if (!end.isValid()) {            endRevisionNumber = startRevisionNumber;        } else {            endRevisionNumber = getRevisionNumber(end, repository, path);        }        if (endRevisionNumber == pegRevisionNumber && startRevisionNumber == pegRevisionNumber) {            SVNRepositoryLocation[] result = new SVNRepositoryLocation[2];            result[0] = new SVNRepositoryLocation(url, startRevisionNumber);            result[1] = new SVNRepositoryLocation(url, endRevisionNumber);            return result;        }        SVNURL rootURL = repository.getRepositoryRoot(true);        long[] revisionsRange = startRevisionNumber == endRevisionNumber ?                 new long[] {startRevisionNumber} : new long[] {startRevisionNumber, endRevisionNumber};                                Map locations = null;        try {            locations = repository.getLocations("", (Map) null, pegRevisionNumber, revisionsRange);        } catch (SVNException e) {            if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_NOT_IMPLEMENTED) {                locations = getLocations10(repository, pegRevisionNumber, startRevisionNumber, endRevisionNumber);            } else {                throw e;            }        }        // try to get locations with 'log' method.        SVNLocationEntry startPath = (SVNLocationEntry) locations.get(new Long(startRevisionNumber));        SVNLocationEntry endPath = (SVNLocationEntry) locations.get(new Long(endRevisionNumber));                if (startPath == null) {            Object source = path != null ? (Object) path : (Object) url;            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_UNRELATED_RESOURCES, "Unable to find repository location for ''{0}'' in revision ''{1}''", new Object[] {source, new Long(startRevisionNumber)});            SVNErrorManager.error(err);        }        if (endPath == null) {            Object source = path != null ? (Object) path : (Object) url;            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_UNRELATED_RESOURCES, "The location for ''{0}'' for revision {1} does not exist in the " +                    "repository or refers to an unrelated object", new Object[] {source, new Long(endRevisionNumber)});            SVNErrorManager.error(err);        }                SVNRepositoryLocation[] result = new SVNRepositoryLocation[2];        SVNURL startURL = SVNURL.parseURIEncoded(SVNPathUtil.append(rootURL.toString(), SVNEncodingUtil.uriEncode(startPath.getPath())));        result[0] = new SVNRepositoryLocation(startURL, startRevisionNumber);        if (end.isValid()) {            SVNURL endURL = SVNURL.parseURIEncoded(SVNPathUtil.append(rootURL.toString(), SVNEncodingUtil.uriEncode(endPath.getPath())));            result[1] = new SVNRepositoryLocation(endURL, endRevisionNumber);        }        return result;    }