* @param allAttr An array that will be populated with all attribute definitions of the class.
* @param sb The buffer where the import statements are accumulated.
*/
// static public void getAttributesAndImports(ClassDefinition cd, String baseClass, ArrayList<AttributeDefinition> allAttr, StringBuffer sb){
static public void getAttributesAndImports(ClassDefinition cd, String baseClass, TreeMap<StringName,AttributeDefinition> allAttr, StringBuffer sb){
BooleanVar needJavaUtil = new BooleanVar(false);
TreeMap<StringName,TypeDefinition> types = new TreeMap<StringName,TypeDefinition>();
collectAllAttributes(cd,allAttr,types,needJavaUtil);
// Iterator<AttributeDefinition> may = cd.getMay();
// if (may != null){
// while(may.hasNext()){
// AttributeDefinition ad = may.next();
// TypeDefinition td = ad.getType();
// types.put(td.getName(), td);
// if (ad.getIsMultiValued())
// needJavaUtil = true;
//
// allAttr.add(ad);
// }
// }
//
// Iterator<AttributeDefinition> must = cd.getMust();
// if (must != null){
// while(must.hasNext()){
// AttributeDefinition ad = must.next();
// TypeDefinition td = ad.getType();
// types.put(td.getName(), td);
// if (ad.getIsMultiValued())
// needJavaUtil = true;
//
// allAttr.add(ad);
// }
// }
if (needJavaUtil.booleanValue())
sb.append("import java.util.*;\n\n");
if (cd.getIsNamedBy() != null){
sb.append("import org.dmd.dmc.DmcAttribute;\n");
}