Skip to content

Commit

Permalink
Further convert to using String
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurens-W committed Dec 10, 2024
1 parent 3786a05 commit addfd85
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2082,19 +2082,19 @@ public void visitPrefixExpression(PrefixExpression unary) {
public TypeTree visitVariableExpressionType(VariableExpression expression) {
JavaType type = typeMapping.type(staticType(((org.codehaus.groovy.ast.expr.Expression) expression)));
Space prefix = whitespace();
StringBuilder keyword = new StringBuilder();
String keyword;

if (expression.isDynamicTyped() || source.charAt(cursor) == ',') {
keyword.append(getKeyword(expression.getName()));
keyword = getKeyword(expression.getName());
} else {
keyword.append(expression.getOriginType().getUnresolvedName());
keyword = expression.getOriginType().getUnresolvedName();
cursor += keyword.length();
}
J.Identifier ident = new J.Identifier(randomId(),
EMPTY,
Markers.EMPTY,
emptyList(),
keyword.toString(),
keyword,
type, null);
if (expression.getOriginType().getGenericsTypes() != null) {
return new J.ParameterizedType(randomId(), prefix, Markers.EMPTY, ident, visitTypeParameterizations(
Expand Down

0 comments on commit addfd85

Please sign in to comment.