Simplify java role version logic