From aa40323ae8dde889f4bcf21304e5cffdc0003b4c Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 14 Jul 2009 00:15:36 +0200 Subject: Fixed a problem where @Data with a static constructor and generics params on the class would generate errors regarding IllegalArgumentException in setSourcePosition in ASTNode. --- src/lombok/eclipse/Eclipse.java | 5 +++++ src/lombok/eclipse/handlers/HandleData.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lombok/eclipse/Eclipse.java b/src/lombok/eclipse/Eclipse.java index 7d852f18..a52b8d86 100644 --- a/src/lombok/eclipse/Eclipse.java +++ b/src/lombok/eclipse/Eclipse.java @@ -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; diff --git a/src/lombok/eclipse/handlers/HandleData.java b/src/lombok/eclipse/handlers/HandleData.java index 066361d2..73ff79b4 100644 --- a/src/lombok/eclipse/handlers/HandleData.java +++ b/src/lombok/eclipse/handlers/HandleData.java @@ -258,7 +258,7 @@ public class HandleData implements EclipseAnnotationHandler { 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); -- cgit