Community
Participate
Working Groups
Created attachment 118591 [details] Adds sanity checking to CompositeArtifactRepository Composite repositories should have the ability to verify if they are in a sane state (all artifacts with the same name and version are the same bytes). I've included a patch that moves the artifactComparator retrieval code out of mirroring and into a new stand alone file. I've also implemented two new methods for CompositeArtifactRepository: addChild(URI, String) which performs a sanity check using a comparator with the ID specified by the string and returns a boolean "true" and adds the UR if it does not conflict with existing children. Otherwise the URI is not added and the method returns false. sanityCheck(String) which checks the existing children to ensure it does not conflict with any other children. Returns true is repository is sonsistent, false otherwise.
One initial comment is that perhaps the sanity check should be called #validate or something like that.
I think you have a point. I also found a rather obvious error in my code that, quite frankly, I shouldn't have allowed to get this far. For now I will change the method name to validate and resubmit a patch when we settle on a method name.
I released a patch for Bug 255678 that contains some of the code from my first patch on this bug. Because of this I am unable to resubmit this patch until my patch for Bug 255678 is released.
Created attachment 119137 [details] Updates previous patch to reflect recent changes in HEAD. Adds test cases.
This patch contains some changes identical to those also included in a patch I submitted for Bug 255691. If this causes merge errors I can resubmit a patch once Bug 255691 is released.
(In reply to comment #5) > This patch contains some changes identical to those also included in a patch I > submitted for Bug 255691. If this causes merge errors I can resubmit a patch > once Bug 255691 is released. > It has been brought to my attention the latest patch as of writing creates compilation errors due to some left over code from a Bug 255691 patch that mistakenly was included. Because this code has since been changed in my latest patch for that bug, I will resubmit once my queue thins out. Sorry for any inconvenience.
Created attachment 119390 [details] Reflects latest changes in HEAD Hopefully this will resolve the issues with applying the previous patch.
At first I released this with a change to use a HashMap to avoid the innermost for loop. But then I changed my mind because we are only likely to have 1 or 2 descriptors per key, so that would not have been worth the effort. Actual changes were minor, plus some string externalizations.