Fixed a java8 specific causing the building of the project to fail.

This fix is the same as dfc9b45f3d25f09d8b7458a77fc6fa770c601853 in a different class.