Better java flavor handling