Fixed a problem where @Data with a static constructor and generics params on the class would generate errors regarding IllegalArgumentException in setSourcePosition in ASTNode.

This commit is contained in:
Reinier Zwitserloot committed 2009-07-14 00:15:36 +02:00
1 parent ba6f353fd8
commit aa40323ae8
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -143,6 +143,11 @@ public class Eclipse {
o.modifiers = param.modifiers;
o.name = param.name;
o.type = copyType(param.type);
o.sourceStart = param.sourceStart;
o.sourceEnd = param.sourceEnd;
o.declarationEnd = param.declarationEnd;
o.declarationSourceStart = param.declarationSourceStart;
o.declarationSourceEnd = param.declarationSourceEnd;
if ( param.bounds != null ) {
TypeReference[] b = new TypeReference[param.bounds.length];
int idx2 = 0;
+1 -1
View File
@@ -258,7 +258,7 @@ public class HandleData implements EclipseAnnotationHandler<Data> {
TypeReference[] refs = new TypeReference[typeDecl.typeParameters.length];
int idx = 0;
for ( TypeParameter param : typeDecl.typeParameters ) {
refs[idx++] = new SingleTypeReference(param.name, 0);
refs[idx++] = new SingleTypeReference(param.name, (long)param.sourceStart << 32 | param.sourceEnd);
}
constructor.returnType = new ParameterizedSingleTypeReference(typeDecl.name, refs, 0, p);
} else constructor.returnType = new SingleTypeReference(((TypeDeclaration)type.get()).name, p);