[modules-dev] [Fwd: [Fwd: Review request: 6563535, URLRepository.install]]
Dave Bristor
David.Bristor at Sun.COM
Wed Aug 15 16:48:17 PDT 2007
Stanley M. Ho wrote:
>
> Dave Bristor wrote:
>> Because ModuleArchiveInfo.equals() is asymmetric with respect to
>> ModuleArchiveInfo.hashCode(). The former is based on equality of
>> references and the latter on equality of hashcodes of a a subset of
>> the instance's fields. Here's the use case that necessitates this:
>> From JRepo's uninstall command,
>> URLRepository.uninstall(ModuleArchiveInfo) is given an instance that
>> is created based on information from the command line, therefore the
>> ModuleArchiveInfo instance is not the one returned by an earlier
>> URLRepository.install().
>
> The way I expected this to work is that Repository.list() will be used
> to obtain a list of ModuleArchiveInfo, then we'll find the one we want
> and pass it to uninstall(). I don't think the repository implementation
> should attempt to recognize any arbitrary ModuleArchiveInfo that is
> passed in. In other words, it should only recognize the ones that it
> created.
OK, that makes sense, so I updated the code to take that into account. In
fact, I looked into JRepo's use of uninstall, and seems that will work as per
your expectations above :-)
>> Now I understand. Fixed, hopefully better, let me know what you
>> think; I updated the webrev:
>> http://analemma.sfbay.sun.com/java/jdk/ws/libs/rev/6563535-b/
>
> Better. Note that the code uses writeRepositoryMetadata to write the
> metadata. However, writeRepositoryMetadata() assumes that the new
> ModuleArchiveInfo is in contents, and it simply iterates the contents
> and writes the metadata out. Now we no longer update the contents
> prematurely, so writeRepositoryMetadata() will need to call
> writeModule() on the "mai" that is passed in.
Now there's a better-than-just-informational use for the mai that's passed in
:-). To make it work for both install and uninstall cases, I added a boolean
to indicate if the given mai should be writeModule'd.
Same webrev updated again; tested on Solaris & Windows.
Thanks,
Dave
>
> - Stanley
More information about the modules-dev
mailing list