Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgChangelog.java @ 365:3572fcb06473
Don't expose methods with DataAccess in public API
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Sun, 11 Dec 2011 00:39:07 +0100 |
parents | d9dfa9fe9cec |
children | 189dc6dc1c3e |
comparison
equal
deleted
inserted
replaced
364:ac8e1ce67730 | 365:3572fcb06473 |
---|---|
236 } catch (CloneNotSupportedException ex) { | 236 } catch (CloneNotSupportedException ex) { |
237 throw new InternalError(ex.toString()); | 237 throw new InternalError(ex.toString()); |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 // FIXME internal class DataAccess as part of API | 241 /*package*/ static RawChangeset parse(DataAccess da) throws IOException { |
242 public static RawChangeset parse(DataAccess da) { | 242 byte[] data = da.byteArray(); |
243 try { | 243 RawChangeset rv = new RawChangeset(); |
244 byte[] data = da.byteArray(); | 244 rv.init(data, 0, data.length, null); |
245 RawChangeset rv = new RawChangeset(); | 245 return rv; |
246 rv.init(data, 0, data.length, null); | |
247 return rv; | |
248 } catch (IOException ex) { | |
249 throw new HgBadStateException(ex); // FIXME "Error reading changeset data" | |
250 } | |
251 } | 246 } |
252 | 247 |
253 // @param usersPool - it's likely user names get repeated again and again throughout repository. can be null | 248 // @param usersPool - it's likely user names get repeated again and again throughout repository. can be null |
249 // FIXME throws "Error reading changeset data" | |
254 /* package-local */void init(byte[] data, int offset, int length, Pool<String> usersPool) { | 250 /* package-local */void init(byte[] data, int offset, int length, Pool<String> usersPool) { |
255 final int bufferEndIndex = offset + length; | 251 final int bufferEndIndex = offset + length; |
256 final byte lineBreak = (byte) '\n'; | 252 final byte lineBreak = (byte) '\n'; |
257 int breakIndex1 = indexOf(data, lineBreak, offset, bufferEndIndex); | 253 int breakIndex1 = indexOf(data, lineBreak, offset, bufferEndIndex); |
258 if (breakIndex1 == -1) { | 254 if (breakIndex1 == -1) { |