}
private final String validateAttributeName(String id,CFMLString cfml, ArrayList<String> args,TagLibTag tag, RefBoolean dynamic, StringBuffer sbType, boolean allowTwiceAttr) throws TemplateException {
if(args.contains(id) && !allowTwiceAttr) throw new TemplateException(cfml,"you can't use the same attribute ["+id+"] twice");
args.add(id);
if(tag==null) return id;
int typeDef=tag.getAttributeType();
if("attributecollection".equals(id)){
dynamic.setValue(tag.getAttribute(id)==null);
sbType.append("struct");
}
else if(typeDef==TagLibTag.ATTRIBUTE_TYPE_FIXED || typeDef==TagLibTag.ATTRIBUTE_TYPE_MIXED) {
TagLibTagAttr attr=tag.getAttribute(id);
if(attr==null) {
if(typeDef==TagLibTag.ATTRIBUTE_TYPE_FIXED) {
String names=tag.getAttributeNames();
if(StringUtil.isEmpty(names))
throw new TemplateException(cfml,"Attribute "+id+" is not allowed for tag "+tag.getFullName());
throw new TemplateException(cfml,
"Attribute "+id+" is not allowed for statement "+tag.getName(),
"valid attribute names are ["+names+"]");
}
dynamic.setValue(true);