Source:
protected static FullRevision parseRevisionImpl(@NonNull String revision, boolean supportMinorMicro, boolean supportPreview, boolean keepPrecision) throws NumberFormatException { if (revision == null) { throw new NumberFormatException("revision is <null>"); } Throwable cause = null; String error = null; try { Matcher m = FULL_REVISION_PATTERN.matcher(revision); if (m != null && m.matches()) { int major = Integer.parseInt(m.group(1)); int minor = IMPLICIT_MINOR_REV; int micro = IMPLICIT_MICRO_REV; int preview = NOT_A_PREVIEW; int precision = PRECISION_MAJOR; String previewSeparator = " "; PreviewType previewType = PreviewType.RC; String s = m.group(2); if (s != null) { if (!supportMinorMicro) { error = " -- Minor number not supported"; } else { minor = Integer.parseInt(s); precision = PRECISION_MINOR; } } s = m.group(3); if (s != null) { if (!supportMinorMicro) { error = " -- Micro number not supported"; } else { micro = Integer.parseInt(s); precision = PRECISION_MICRO; } } s = m.group(6); if (s != null) { if (!supportPreview) { error = " -- Preview number not supported"; } else { preview = Integer.parseInt(s); previewSeparator = m.group(4); precision = PRECISION_PREVIEW; for (PreviewType pt : PreviewType.values()) { if (pt.name.equals(m.group(5))) { previewType = pt; break; } } } } if (error == null) { if (keepPrecision) { return new PreciseRevision(major, minor, micro, preview, precision, previewSeparator); } else { return new FullRevision(major, minor, micro, preview, previewSeparator, previewType); } } } } catch (Throwable t) { cause = t; } NumberFormatException n = new NumberFormatException( "Invalid revision: " + revision + (error == null ? "" : error)); if (cause != null) { n.initCause(cause); } throw n; }

Target:
protected static FullRevision parseRevisionImpl(@NonNull String revision, boolean supportMinorMicro, boolean supportPreview, boolean keepPrecision) throws NumberFormatException { if (revision == null) { throw new NumberFormatException("revision is <null>"); } Throwable cause = null; String error = null; try { Matcher m = FULL_REVISION_PATTERN.matcher(revision); if (m != null && m.matches()) { int major = Integer.parseInt(m.group(1)); int minor = IMPLICIT_MINOR_REV; int micro = IMPLICIT_MICRO_REV; int preview = NOT_A_PREVIEW; int precision = PRECISION_MAJOR; String previewSeparator = " "; PreviewType previewType = PreviewType.RC; String s = m.group(2); if (s != null) { if (!supportMinorMicro) { error = " -- Minor number not supported"; } else { minor = Integer.parseInt(s); precision = PRECISION_MINOR; } } s = m.group(3); if (s != null) { if (!supportMinorMicro) { error = " -- Micro number not supported"; } else { micro = Integer.parseInt(s); precision = PRECISION_MICRO; } } s = m.group(6); if (s != null) { if (!supportPreview) { error = " -- Preview number not supported"; } else { preview = Integer.parseInt(s); previewSeparator = m.group(4); precision = PRECISION_PREVIEW; for (PreviewType pt : PreviewType.values()) { if (pt.name.equals(m.group(5))) { previewType = pt; break; } } } } if (error == null) { if (keepPrecision) { return new PreciseRevision(major, minor, micro, preview, precision, previewSeparator); } else { return new FullRevision(major, minor, micro, previewType, preview, previewSeparator); } } } } catch (Throwable t) { cause = t; } NumberFormatException n = new NumberFormatException( "Invalid revision: " + revision + (error == null ? "" : error)); if (cause != null) { n.initCause(cause); } throw n; }