// look for a class whose name matches some initial segment of pathList
TypeGroup typeGroup = getTypeGroup();
ownerType = Type.dereference(typeGroup.create(ownerTypeName));
if (ownerType.isUndefined()) {
throw new TypeException("StaticExpression.typeCheck : invalid path " + ownerTypeName + " to static field " + fieldName + getPos());
}
Class clazz = ownerType.getTargetClass();
try {
field = lookupField(clazz);
} catch (NoSuchFieldException e) {
// oops
throw new TypeException("StaticExpression.typeCheck : invalid field name " + fieldName + getPos());
}
if ((field.getModifiers() & Modifier.STATIC)== 0) {
// oops
throw new TypeException("StaticExpression.typeCheck : field is not static " + fieldName + getPos());
}
clazz = field.getType();
type = typeGroup.ensureType(clazz);
}