public <X> void populate(AbstractManagedType<X> type) {
Class<X> cls = type.getJavaType();
Class<?> mcls = repos.getMetaModel(cls, true);
if (mcls == null)
return;
StaticMetamodel anno = mcls.getAnnotation(StaticMetamodel.class);
if (anno == null)
throw new IllegalArgumentException(_loc.get("meta-class-no-anno",
mcls.getName(), cls.getName(), StaticMetamodel.class.getName()).getMessage());
if (cls != anno.value()) {
throw new IllegalStateException(_loc.get("meta-class-mismatch",
mcls.getName(), cls.getName(), anno.value()).getMessage());
}
ParameterizedType mfType = null;
Attribute<? super X, ?> f = null;
Field[] mfields = AccessController.doPrivileged(J2DoPrivHelper.getDeclaredFieldsAction(mcls));