Re: [PATCH JGit 2/5] Create abstract method on ObjectDatabase for accessing the list of local pack files.
- From
Michael Gaffney <mr.gaffo@gmail.com>
- Date
- Sep 21, 2009, 19:51 UTC
- Message-ID
- <4AB7D950.9000600@gmail.com>
- In-Reply-To
- <20090921194035.GM14660@spearce.org>
Shawn O. Pearce wrote:
> Why not allow the ObjectDirectory code to create the directory > before copying the pack into it?
Good point, this was one of the first tests I did before I got to that part of ObjectDirectory. Will fix.
> Don't you mean the list of packs this object database contains? > An object database may not be a git repository. Though yes, the > common case is that it is a repository.
What's the difference in terminology? Not aruging, just wanting to know what we're calling a repo and what we're not so that I use it correctly. Will fix.
Show 5 quoted lines
>> + public abstract List<PackFile> listLocalPacks(); > > I think you should define this to be an unmodifiable list, not just > any list. Its sad that the Java type system didn't support this > idea back when they added the new collections APIs.
Should it be a collection as well instead of a list; what would you specifically suggest?
> Instead of copying, why not return an unmodifiableList wrapped > around the array? PackList will never modify its internal array.
Same as above
-Mike