From 6087388aca5eb50054732c2f606fa21165e88b75 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Mon, 5 May 2008 22:55:19 +0000 Subject: Fixing annotation parsing of empty arrays. --- .../java/com/amazon/carbonado/util/AnnotationDescParser.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/amazon') diff --git a/src/main/java/com/amazon/carbonado/util/AnnotationDescParser.java b/src/main/java/com/amazon/carbonado/util/AnnotationDescParser.java index 09871d9..533f086 100644 --- a/src/main/java/com/amazon/carbonado/util/AnnotationDescParser.java +++ b/src/main/java/com/amazon/carbonado/util/AnnotationDescParser.java @@ -105,7 +105,13 @@ public class AnnotationDescParser { Annotation.MemberValue mv; if (propTag == TAG_ARRAY) { mPos++; - mv = parseArray(dest, peekTag(), parseTypeDesc()); + char compTag = peekTag(); + if (compTag == ';') { + // Empty array. + mv = dest.makeMemberValue(new Annotation.MemberValue[0]); + } else { + mv = parseArray(dest, compTag, parseTypeDesc()); + } } else { mv = parseProperty(dest, propTag, parseTypeDesc()); } @@ -220,7 +226,7 @@ public class AnnotationDescParser { switch (mStr.charAt(mPos)) { default: - throw error("Invalid tag"); + throw error("Invalid tag '" + mStr.charAt(mPos) + '\''); case TAG_ARRAY: mPos++; -- cgit v1.2.3