backport java 7 compilation fix from 1.3.x