Critical-current density from magnetization loops of finite high-T c superconductors