migration to the java 1.8
(cherry picked from commit e382662)