From 60cb3d99e3661103d20cdd7a9d599c62fe2d4b8f Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Thu, 5 Jun 2014 13:50:59 +0000 Subject: QPID-5721: [Java Broker] Improve test coverage for default attributes, and attributes whose values are computed from context variables. Also fixed defect so that a context attributes are resolved first, so that other attribute values may be calculated from context variables set on the same object. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1600657 13f79535-47bb-0310-9956-ffa450edef68 --- .../qpid/server/model/validation/AttributeAnnotationValidator.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qpid/java/broker-codegen/src') diff --git a/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java b/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java index 1422a52449..a831e1ebd9 100644 --- a/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java +++ b/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/validation/AttributeAnnotationValidator.java @@ -310,6 +310,10 @@ public class AttributeAnnotationValidator extends AbstractProcessor if(typeUtils.isSameType(erasedType, getErasure("java.util.Map"))) { List args = ((DeclaredType) type).getTypeArguments(); + if (args.size() != 2) + { + throw new IllegalArgumentException("Map types " + type + " must have exactly two type arguments"); + } return isValidType(args.get(0)) && (isValidType(args.get(1)) || typeUtils.isSameType(args.get(1), getErasure("java.lang.Object"))); } -- cgit v1.2.1