String fieldName = "";
for(Object attribute : manType.getDeclaredAttributes()) {
try {
fieldName = ((Attribute)attribute).getName();
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
((Field)AccessController.doPrivileged(new PrivilegedGetDeclaredField(clazz, fieldName, false))).set(clazz, attribute);
} else {
PrivilegedAccessHelper.getDeclaredField(clazz, fieldName, false).set(clazz, attribute);
}
} catch (NoSuchFieldException nsfe) {
// Ignore fields missing in canonical model (dclarke bug 346106)