in Java code example fix variable name for consistency

cc: @ctrueden