The JDT sometimes returns simplified type signatures, for example the IMethod#getParameterTypes() method can return values such as QString instead of java.lang.String.
To decode such values, the org.eclipse.jdt.core.Signature class provides utility functions. Signature#getSignatureSimpleName(String) transforms QString into the simple name, i.e. String.
To get the full name, the containing type allows to resolve the simple name. IType#resolveType(String) transforms this simple name using the imports of the containing type. The result is an array with two dimensions. The first one is for the case where there are multiple answers possible. The second one separates the name of the package and the simple name.
The following code returns the first full name of a method return type:
String name = method.getReturnType(); String simpleName = Signature.getSignatureSimpleName(name); IType type = method.getDeclaringType(); String[][] allResults = type.resolveType(simpleName); String fullName = null; if(allResults != null) { String[] nameParts = allResults[0]; if(nameParts != null) { fullName = new String(); for(int i=0 ; i < nameParts.length ; i++) { if(fullName.length() > 0) { fullName += '.'; } if(nameParts[i] != null) { fullName += nameParts[i]; } } } } return name;
An exchange on stackoverflow details the code for parameters types full names.