summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/util
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-05-05 22:55:19 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-05-05 22:55:19 +0000
commit6087388aca5eb50054732c2f606fa21165e88b75 (patch)
tree7743efcfbdaa4c3cf1648984183eaeb220596587 /src/main/java/com/amazon/carbonado/util
parent0881e0448a861ead9b0415e7992290e6a836c71b (diff)
Fixing annotation parsing of empty arrays.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/util')
-rw-r--r--src/main/java/com/amazon/carbonado/util/AnnotationDescParser.java10
1 files changed, 8 insertions, 2 deletions
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++;