Mercurial > jhg
diff src/org/tmatesoft/hg/repo/HgDataFile.java @ 416:d30083c80d52
Better names - non-confusing and aligned with the rest of API
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 22 Mar 2012 19:11:33 +0100 |
parents | ee8264d80747 |
children | ccd7d25e5aea |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgDataFile.java Thu Mar 22 18:54:11 2012 +0100 +++ b/src/org/tmatesoft/hg/repo/HgDataFile.java Thu Mar 22 19:11:33 2012 +0100 @@ -88,7 +88,7 @@ } /** - * Handy shorthand for {@link #length(int) length(getRevisionIndex(nodeid))} + * Handy shorthand for {@link #getLength(int) length(getRevisionIndex(nodeid))} * * @param nodeid revision of the file * @@ -96,9 +96,9 @@ * @throws HgInvalidRevisionException if supplied nodeid doesn't identify any revision from this revlog (<em>runtime exception</em>) * @throws HgInvalidControlFileException if access to revlog index/data entry failed */ - public int length(Nodeid nodeid) throws HgInvalidControlFileException, HgInvalidRevisionException { + public int getLength(Nodeid nodeid) throws HgInvalidControlFileException, HgInvalidRevisionException { try { - return length(getRevisionIndex(nodeid)); + return getLength(getRevisionIndex(nodeid)); } catch (HgInvalidControlFileException ex) { throw ex.isRevisionSet() ? ex : ex.setRevision(nodeid); } catch (HgInvalidRevisionException ex) { @@ -107,12 +107,20 @@ } /** + * @deprecated Use {@link #getLength(Nodeid)} instead + */ + @Deprecated + public int length(Nodeid nodeid) throws HgInvalidControlFileException, HgInvalidRevisionException { + return getLength(nodeid); + } + + /** * @param fileRevisionIndex - revision local index, non-negative. From predefined constants, only {@link HgRepository#TIP} makes sense. * @return size of the file content at the revision identified by local revision number. * @throws HgInvalidRevisionException if supplied argument doesn't represent revision index in this revlog (<em>runtime exception</em>) * @throws HgInvalidControlFileException if access to revlog index/data entry failed */ - public int length(int fileRevisionIndex) throws HgInvalidControlFileException, HgInvalidRevisionException { + public int getLength(int fileRevisionIndex) throws HgInvalidControlFileException, HgInvalidRevisionException { if (wrongRevisionIndex(fileRevisionIndex) || fileRevisionIndex == BAD_REVISION) { throw new HgInvalidRevisionException(fileRevisionIndex); } @@ -138,6 +146,14 @@ } return dataLen; } + + /** + * @deprecated Use {@link #getLength(int)} instead + */ + @Deprecated + public int length(int fileRevisionIndex) throws HgInvalidControlFileException, HgInvalidRevisionException { + return getLength(fileRevisionIndex); + } /** * Reads content of the file from working directory. If file present in the working directory, its actual content without @@ -549,6 +565,8 @@ */ /** + * + * @param fileRevisionIndex - revision local index, non-negative, or {@link HgRepository#TIP}. * FIXME EXCEPTIONS * @throws HgInvalidControlFileException * @throws HgInvalidRevisionException @@ -557,7 +575,7 @@ int changesetRevIndex = getChangesetRevisionIndex(fileRevisionIndex); return getRepo().getManifest().extractFlags(changesetRevIndex, getPath()); } - + @Override public String toString() { StringBuilder sb = new StringBuilder(getClass().getSimpleName());