Issue #2120497 by baisong: code review