* Use function instead of scala partial function for java api #26970 * Remove deprecated function #26970