// structures.
while (variants.hasNext()) {
Variant variant = (Variant) variants.next();
Selection selection = variant.getSelection();
if (selection instanceof TargetedSelection) {
TargetedSelection targetedSelection =
(TargetedSelection) selection;
// Only generate categories if they are supported by this
// policy.
if (hasCategories) {
List categories = targetedSelection.getCategoryReferences();
if (categories != null && !categories.isEmpty()) {
category2Variant =
targetVariantAtCategories(variant, categories,
category2Variant);
}
}
List devices = targetedSelection.getDeviceReferences();
if (devices != null && !devices.isEmpty()) {
device2Variant = targetVariantAtDevices(variant, devices,
device2Variant);
}
} else if (selection instanceof DefaultSelection) {