diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-23 19:13:03 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-23 19:13:03 +0200 |
commit | e85ef24b4d99f922f77439d9ba5e0e27717f2d31 (patch) | |
tree | 577c4693074cd289fe9103f4bec836fd2974ad35 /src/lombok/eclipse/handlers/HandleData.java | |
parent | 8bbdcec6fad6edf8f335f9e0c6899fddc56e07c1 (diff) | |
download | lombok-e85ef24b4d99f922f77439d9ba5e0e27717f2d31.tar.gz lombok-e85ef24b4d99f922f77439d9ba5e0e27717f2d31.tar.bz2 lombok-e85ef24b4d99f922f77439d9ba5e0e27717f2d31.zip |
Fixed some bugs in copyType(), and now the static constructor is generated without any raw generics warnings - it is effectively done.
Diffstat (limited to 'src/lombok/eclipse/handlers/HandleData.java')
-rw-r--r-- | src/lombok/eclipse/handlers/HandleData.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lombok/eclipse/handlers/HandleData.java b/src/lombok/eclipse/handlers/HandleData.java index 27757e7d..65072ab1 100644 --- a/src/lombok/eclipse/handlers/HandleData.java +++ b/src/lombok/eclipse/handlers/HandleData.java @@ -38,6 +38,7 @@ import org.eclipse.jdt.internal.compiler.ast.MessageSend; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.NullLiteral; import org.eclipse.jdt.internal.compiler.ast.OperatorIds; +import org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference; import org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference; import org.eclipse.jdt.internal.compiler.ast.ReturnStatement; import org.eclipse.jdt.internal.compiler.ast.SingleNameReference; @@ -47,6 +48,7 @@ import org.eclipse.jdt.internal.compiler.ast.StringLiteral; import org.eclipse.jdt.internal.compiler.ast.ThisReference; import org.eclipse.jdt.internal.compiler.ast.TrueLiteral; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; +import org.eclipse.jdt.internal.compiler.ast.TypeParameter; import org.eclipse.jdt.internal.compiler.ast.TypeReference; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; @@ -188,7 +190,15 @@ public class HandleData implements EclipseAnnotationHandler<Data> { ((CompilationUnitDeclaration) type.top().get()).compilationResult); constructor.modifiers = PKG.toModifier(AccessLevel.PUBLIC) | Modifier.STATIC; - constructor.returnType = new SingleTypeReference(((TypeDeclaration)type.get()).name, p); + TypeDeclaration typeDecl = (TypeDeclaration) type.get(); + if ( typeDecl.typeParameters != null && typeDecl.typeParameters.length > 0 ) { + TypeReference[] refs = new TypeReference[typeDecl.typeParameters.length]; + int idx = 0; + for ( TypeParameter param : typeDecl.typeParameters ) { + refs[idx++] = new SingleTypeReference(param.name, 0); + } + constructor.returnType = new ParameterizedSingleTypeReference(typeDecl.name, refs, 0, p); + } else constructor.returnType = new SingleTypeReference(((TypeDeclaration)type.get()).name, p); constructor.annotations = null; constructor.selector = name.toCharArray(); constructor.thrownExceptions = null; |