aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse/Eclipse.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/lombok/eclipse/Eclipse.java')
-rw-r--r--src/lombok/eclipse/Eclipse.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lombok/eclipse/Eclipse.java b/src/lombok/eclipse/Eclipse.java
index 33164ab5..017affa1 100644
--- a/src/lombok/eclipse/Eclipse.java
+++ b/src/lombok/eclipse/Eclipse.java
@@ -255,10 +255,19 @@ public class Eclipse {
}
public static Annotation[] copyAnnotations(Annotation[] annotations) {
- if (annotations == null) return null;
- Annotation[] outs = new Annotation[annotations.length];
+ return copyAnnotations(annotations, null);
+ }
+
+ public static Annotation[] copyAnnotations(Annotation[] annotations1, Annotation[] annotations2) {
+ if (annotations1 == null && annotations2 == null) return null;
+ if (annotations1 == null) annotations1 = new Annotation[0];
+ if (annotations2 == null) annotations2 = new Annotation[0];
+ Annotation[] outs = new Annotation[annotations1.length + annotations2.length];
int idx = 0;
- for ( Annotation annotation : annotations ) {
+ for ( Annotation annotation : annotations1 ) {
+ outs[idx++] = copyAnnotation(annotation);
+ }
+ for ( Annotation annotation : annotations2 ) {
outs[idx++] = copyAnnotation(annotation);
}
return outs;