assert signature != null;
assert javaProject != null;
final String elementType = Signature.getElementType(signature);
IJavaTypeDescriptor2 desc =
SymbolFactory.eINSTANCE.createIJavaTypeDescriptor2();
final int arrayCount = Signature.getArrayCount(signature);
if (arrayCount > 0)
{
desc.setArrayCount(arrayCount);
}
IType type = TypeUtil.resolveType(javaProject, elementType);
if (type != null)
{
desc.setType(type);
}
else
{
desc.setTypeSignatureDelegate(Signature.getTypeErasure(signature));
}
desc.getTypeParameterSignatures().addAll(Arrays.asList(Signature.getTypeArguments(signature)));
IComponentSymbol symbol = SymbolFactory.eINSTANCE.createIComponentSymbol();
symbol.setName(symbolName);
symbol.setTypeDescriptor(desc);
symbol.setRuntimeSource(ERuntimeSource.TAG_INSTANTIATED_SYMBOL_LITERAL);