};
@Override
protected ISWFTagsRequestResult handleSWFTagsRequest() throws InterruptedException
{
final IABCBytesRequestResult abc = getABCBytesRequest().get();
startProfile(Operation.GET_SWF_TAGS);
try
{
final String tagName;
if (Strings.isNullOrEmpty(qname))
{
final IFileScopeRequestResult fileScopeRR = getFileScopeRequest().get();
final Collection<IDefinition> externallyVisibleDefinitions =
fileScopeRR.getExternallyVisibleDefinitions();
if (!externallyVisibleDefinitions.isEmpty())
{
ArrayList<IDefinition> sortedDefinitions =
new ArrayList<IDefinition>(externallyVisibleDefinitions.size());
Iterables.addAll(sortedDefinitions, externallyVisibleDefinitions);
Collections.sort(sortedDefinitions, SCRIPT_NAME_DEFINITION_COMPARATOR);
tagName = sortedDefinitions.get(0).getQualifiedName().replace('.', '/');
}
else
{
tagName = getName();
}
}
else
{
tagName = qname.replace('.', '/');
}
return new SWFTagsRequestResult(abc.getABCBytes(), tagName, abc.getEmbeds());
}
finally
{
stopProfile(Operation.GET_SWF_TAGS);
}