[java] Fixed bad haxe.Template type inferention. Closes #2254
[java] do/while(false) is not dead code. Closes #2271