// go through the attrBundleMap and turn each entry into an
// AttrBundleParam and put this into the builder map.
for (Map.Entry<String, Map<AttributeValidator, Attribute>> attrBundle :
attrBundles.entrySet()) {
FormalParameter parameter = callee.getParameterByPrimary(attrBundle.getKey());
BundleType bt = (BundleType) parameter.getType();
// special case for the (common case) of a single bundle on the
// callee side. In this case there is no mixing of attributes
// between bundles so the GxpAttrBundleBuilder does not need to
// include only some attributes from passed in bundles. See the
// empty constructor in j/c/g/gxp/base/GxpAttrBundleBuilder.java
Set<String> includeAttrs = (attrBundles.size() == 1)
? Collections.<String>emptySet() : bt.getAttrMap().keySet();
AttrBundleParam newBundle =
new AttrBundleParam(call, callee.getSchema(), includeAttrs,
attrBundle.getValue(), call.getAttrBundles());