[Misc] Fix deprecated call, replacing with a JDK7 alternative