[java] Properly cast TNull. Closes #3306