for (String pkg : bndImports.keySet())
{
unused.remove(pkg);
Map<String, String> attrs = bndImports.get(pkg);
String currentVersion = (String) attrs.get(BldAttr.VERSION_ATTRIBUTE);
IPackageImport pi = imports.get(pkg);
if (pi != null)
{
VersionRange range = pi.getVersions();
String version = range.toString();
if (!version.equals(currentVersion)
&& !range.equals(VersionRange.ANY_VERSION))
{
attrs.put(BldAttr.VERSION_ATTRIBUTE, version);
if (pi.isOptional())
attrs.put(BldAttr.RESOLUTION_ATTRIBUTE,
BldAttr.RESOLUTION_OPTIONAL);
modified.add(pkg + ";version=" + version
+ (pi.isOptional() ? ";optional" : ""));
}
else if ((currentVersion == null) && !systemPkgs.contains(pkg))
{
unversioned.add(pkg);
}