JiraRestApi (@NotNull JiraVersion jiraVersion, @NotNull JiraRepository repository) { if (jiraVersion.getMajorNumber() == 4 && jiraVersion.getMinorNumber() >= 2) { return new JiraRestApi20Alpha1(repository); } else if (jiraVersion.getMajorNumber() >= 5) { return new JiraRestApi2(repository); } else { LOG.warn("JIRA below 4.2.0 doesn't support REST API (" + jiraVersion + " used)"); return null; } }