Fix compilation for Java 7

Target: 2.11
Patch: none
(cherry picked from commit 6d40f30d745078adda172fe8813aa0774111673f)