public String getProducedTypeName(boolean abbreviate) { if (getDeclaration() == null) { // unknown type return null; } if (abbreviate && getDeclaration() instanceof UnionType) { UnionType ut = (UnionType) getDeclaration(); if (ut.getCaseTypes().size() == 2) { Unit unit = getDeclaration().getUnit(); if (Util.isElementOfUnion(ut, unit.getNothingDeclaration())) { return unit.getDefiniteType(this).getProducedTypeName() + "?"; } if (Util.isElementOfUnion(ut, unit.getEmptyDeclaration()) && Util.isElementOfUnion(ut, unit.getSequenceDeclaration())) { return unit.getElementType(this).getProducedTypeName() + "[]"; } } } String producedTypeName = ""; if (getDeclaration().isMember()) { producedTypeName += getQualifyingType().getProducedTypeName(abbreviate); producedTypeName += "."; } producedTypeName += getDeclaration().getName(); if (!getTypeArgumentList().isEmpty()) { producedTypeName += "<"; for (ProducedType t : getTypeArgumentList()) { if (t == null) { producedTypeName += "unknown,"; } else { producedTypeName += t.getProducedTypeName(abbreviate) + ","; } } producedTypeName += ">"; producedTypeName = producedTypeName.replace(",>", ">"); } return producedTypeName; }