Skip to content

Commit

Permalink
Fix part of testAnnotateClassTypeParameter1 - generics
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Mar 14, 2024
1 parent 4e373ca commit e3aa621
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,22 @@ private AbstractTypeDeclaration convertClassDecl(JCClassDecl javacClassDecl, AST
}

private TypeParameter convert(JCTypeParameter typeParameter) {
final TypeParameter typeParameter2 = new TypeParameter(this.ast);
final TypeParameter ret = new TypeParameter(this.ast);
final SimpleName simpleName = new SimpleName(this.ast);
simpleName.internalSetIdentifier(typeParameter.getName().toString());
int start = typeParameter.pos;
int end = typeParameter.pos + typeParameter.getName().length();
simpleName.setSourceRange(start, end - start + 1);
typeParameter2.setName(simpleName);
ret.setName(simpleName);
int annotationsStart = start;
List bounds = typeParameter.bounds;
Iterator i = bounds.iterator();
while(i.hasNext()) {
JCTree t = (JCTree)i.next();
Type type = convertToType(t);
ret.typeBounds().add(type);
end = type.getStartPosition() + type.getLength() - 1;
}
// org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations = typeParameter.annotations;
// if (annotations != null) {
// if (annotations[0] != null)
Expand All @@ -385,13 +393,13 @@ private TypeParameter convert(JCTypeParameter typeParameter) {
// }
// start = annotationsStart < typeParameter.declarationSourceStart ? annotationsStart : typeParameter.declarationSourceStart;
// end = retrieveClosingAngleBracketPosition(end);
typeParameter2.setSourceRange(start, end - start + 1);
// if (this.resolveBindings) {
// recordName(simpleName, typeParameter);
// recordNodes(typeParameter2, typeParameter);
// typeParameter2.resolveBinding();
// }
return typeParameter2;
ret.setSourceRange(start, end - start + 1);
return ret;
}

private ASTNode convertBodyDeclaration(JCTree tree, ASTNode parent) {
Expand Down

0 comments on commit e3aa621

Please sign in to comment.