On Nov 11, 2007 12:58 PM, Eranb <[EMAIL PROTECTED]> wrote: > Hi Xavier, > > Thank you for your prompt reply. > > However, it seems that I was not very clear. > I actually ment the lower bound. > To be more specific - in case the version in the release repository is: > 4.2.0.3 (just as the lower bound) it is rejected. > > It seems to me like it is a critical bug. For first release versions are > never found. Further more - according to Ivy documentation for version > range > using '[' the first version should be included !
Indeed, it should, and that's what the equality comparison at the beginning of the comparator should make work. But if you say it doesn't, it's a bug. Maybe the bug is in the equals implementation, I don't know. Please open a JIRA issue, and try to give as much detail as possible on your environment. A junit test case reproducing the issue would be great! As you can see in our current unit test for version range matcher [1], all cases should be tested, so I think the problem happens only in some specific case. Xavier [1] https://svn.apache.org/repos/asf/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/version/VersionRangeMatcherTest.java > > > Thanks, > Eran B. > -----Original Message----- > From: Xavier Hanin [mailto:[EMAIL PROTECTED] > Sent: Sunday, November 11, 2007 12:50 PM > To: ivy-user@incubator.apache.org > Subject: Re: Ivy VersionRangeMatcher lower range bug [4.2.0.3,4.2.+] > > Indeed, the version range matcher has not been thought to handle another > dynamic revision as one bound, so I'm not surprised it doesn't work. Open > an > issue in JIRA, but IMO this is more an undocumented limitation than a > bug. > > Xavier > > On Nov 11, 2007 10:50 AM, Eran Bartenstein <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > In my version it seems that there is a bug in the VersionRangeMatcher. > > In case the found version is identical to the lower version it is being > > discarded by the matcher and the jar is not found. > > I checked in the code and it seems that there is a bug in the following > > code: > > > > In VersionRangeMatcher (L:83) > > > > The following code doesn't return 0 in case the modules (art1,art2) are > > identical in content but not in instances: > > > > private final Comparator COMPARATOR = new Comparator() { > > public int compare(Object o1, Object o2) { > > if (o1.equals(o2)) { > > return 0; > > } > > ArtifactInfo art1 = new > > MRIDArtifactInfo((ModuleRevisionId)o1); > > ArtifactInfo art2 = new > > MRIDArtifactInfo((ModuleRevisionId)o2); > > ArtifactInfo art = > > getLatestStrategy().findLatest(new ArtifactInfo[] {art1,art2}, null); > > return art == art1 ? -1 : 1; > > } > > }; > > > > Thanks, > > > > Eran Bartenstein > > SCE Team leader > > > > > > 1 Hanagar Street > > P.O.B. 7188 > > Hod Hasharon 45241 Israel > > * Phone : 972 9 7627734 > > 7 Fax : 972 9 7412060 > > * [EMAIL PROTECTED] > > www.personeta.com <http://www.personeta.com/> > > > > > > Always look on the bright side of life, for: > > 'you come from nothing, > > you go back to nothing, > > what did you lose ? > > NOTHING' > > (Monty Python) > > > > > > > -- > Xavier Hanin - Independent Java Consultant > http://xhab.blogspot.com/ > http://ant.apache.org/ivy/ > http://www.xoocode.org/ > > -- Xavier Hanin - Independent Java Consultant http://xhab.blogspot.com/ http://ant.apache.org/ivy/ http://www.xoocode.org/