{
selection.add("" + indexList.get(i));
}
for (int k = 0; (osversions != null) && (k < osversions.length); k++)
{
VersionRange range = VersionRange.parse(osversions[k]);
if ((range.getFloor()).compareTo(osVersionRangeMaxFloor) >= 0)
{
osVersionRangeMaxFloor = range.getFloor();
}
}
}
if (selection.size() == 1)
{
return Integer.parseInt(selection.get(0).toString());
}
else if (selection.size() > 1)
{
// Keep only selected clauses with an 'osversion'
// equal to the max floor of 'osversion' ranges.
indexList = selection;
selection = new ArrayList();
for (int i = 0; i < indexList.size(); i++)
{
int index = Integer.parseInt(indexList.get(i).toString());
String[] osversions = ((R4LibraryClause) clauseList.get(index)).getOSVersions();
for (int k = 0; k < osversions.length; k++)
{
VersionRange range = VersionRange.parse(osversions[k]);
if ((range.getFloor()).compareTo(osVersionRangeMaxFloor) >= 0)
{
selection.add("" + indexList.get(i));
}
}
}