Use scala deprecation instead of java.