Skip to content

Commit

Permalink
further simplification: in that part typeArguments cannot be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Dec 31, 2023
1 parent fdad984 commit 28a2e11
Showing 1 changed file with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1106,24 +1106,18 @@ protected void constructorCallToJavaExpression(final XConstructorCall expr, ITre
ITreeAppendable typeAppendable = appendableWithNewKeyword.trace(expr, XbasePackage.Literals.XCONSTRUCTOR_CALL__CONSTRUCTOR, 0);
appendConstructedTypeName(expr, typeAppendable);
if (hasTypeArguments) {
if (typeArguments.isEmpty()) {
LightweightTypeReference createdType = resolvedTypes.getActualType(expr);
typeArguments = createdType.getNamedType().getTypeArguments();
}
if (!typeArguments.isEmpty()) {
typeAppendable.append("<");
for(int i = 0; i < typeArguments.size(); i++) {
if (i != 0) {
typeAppendable.append(", ");
}
if (explicitTypeArguments.isEmpty()) {
typeAppendable.append(typeArguments.get(i));
} else {
typeAppendable.trace(explicitTypeArguments.get(i), false).append(typeArguments.get(i));
}
typeAppendable.append("<");
for(int i = 0; i < typeArguments.size(); i++) {
if (i != 0) {
typeAppendable.append(", ");
}
if (explicitTypeArguments.isEmpty()) {
typeAppendable.append(typeArguments.get(i));
} else {
typeAppendable.trace(explicitTypeArguments.get(i), false).append(typeArguments.get(i));
}
typeAppendable.append(">");
}
typeAppendable.append(">");
}
b.append("(");
appendArguments(expr.getArguments(), b);
Expand Down

0 comments on commit 28a2e11

Please sign in to comment.