String (boolean upToFeature, boolean upToUpdate) { StringBuilder sb = new StringBuilder(); if (feature > 8) { sb.append(feature); if (!upToFeature) { if (minor > 0 || update > 0) sb.append('.').append(minor); if (update > 0) sb.append('.').append(update); if (!upToUpdate) { if (ea) sb.append("-ea"); if (build > 0) sb.append('+').append(build); } } } else { sb.append("1.").append(feature); if (!upToFeature) { if (minor > 0 || update > 0 || ea || build > 0) sb.append('.').append(minor); if (update > 0) sb.append('_').append(update); if (!upToUpdate) { if (ea) sb.append("-ea"); if (build > 0) sb.append("-b").append(build); } } } return sb.toString(); }