String (@NotNull String versionId, @NotNull AbstractVcs vcs) { String vcsPattern = vcs.getRevisionPattern(); if (vcsPattern != null) { Pattern revisionPattern = Pattern.compile(String.format(ourRevisionPatternTemplate, vcsPattern)); Matcher revisionMatcher = revisionPattern.matcher(versionId); if (revisionMatcher.find()) { return revisionMatcher.group(1); } } return null; }