aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2012-01-30 19:48:12 +0100
committerRoel Spilker <r.spilker@gmail.com>2012-01-30 19:48:12 +0100
commit55384884d380fba1a5fe024e1d82329d71c36f02 (patch)
treea19f69b9a4da56b58abb96e0a79d852eeb659bb0 /src/utils
parent98875218ea3f6ba68f7f83d3e0458c9901db00f3 (diff)
parentfc7ca61aeb3ee06c426573b5059e97532b601172 (diff)
downloadlombok-55384884d380fba1a5fe024e1d82329d71c36f02.tar.gz
lombok-55384884d380fba1a5fe024e1d82329d71c36f02.tar.bz2
lombok-55384884d380fba1a5fe024e1d82329d71c36f02.zip
Merge branch 'master' of github.com:rzwitserloot/lombok
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/lombok/eclipse/Eclipse.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils/lombok/eclipse/Eclipse.java b/src/utils/lombok/eclipse/Eclipse.java
index fce0773b..7d21faa2 100644
--- a/src/utils/lombok/eclipse/Eclipse.java
+++ b/src/utils/lombok/eclipse/Eclipse.java
@@ -43,6 +43,7 @@ import org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
public class Eclipse {
+ private static final Annotation[] EMPTY_ANNOTATIONS_ARRAY = new Annotation[0];
/**
* Eclipse's Parser class is instrumented to not attempt to fill in the body of any method or initializer
* or field initialization if this flag is set. Set it on the flag field of
@@ -120,7 +121,7 @@ public class Eclipse {
*/
public static Annotation[] findAnnotations(FieldDeclaration field, Pattern namePattern) {
List<Annotation> result = new ArrayList<Annotation>();
- if (field.annotations == null) return new Annotation[0];
+ if (field.annotations == null) return EMPTY_ANNOTATIONS_ARRAY;
for (Annotation annotation : field.annotations) {
TypeReference typeRef = annotation.type;
if (typeRef != null && typeRef.getTypeName()!= null) {
@@ -131,7 +132,7 @@ public class Eclipse {
}
}
}
- return result.toArray(new Annotation[0]);
+ return result.toArray(EMPTY_ANNOTATIONS_ARRAY);
}
/**