Skip to content

Commit

Permalink
JENKINS-33859 - Mark existIssue deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
rantoniuk committed May 3, 2016
1 parent 9dd3bae commit 1d1747f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/main/java/hudson/plugins/jira/JiraSession.java
Expand Up @@ -177,6 +177,7 @@ public List<IssueType> getIssueTypes() {
return service.getIssueTypes();
}

@Deprecated
public boolean existsIssue(String id) {
return site.existsIssue(id);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/plugins/jira/JiraSite.java
Expand Up @@ -402,8 +402,10 @@ public static JiraSite get(Job<?, ?> p) {
* This method checks whether the key portion is a valid key (except that
* it can potentially use stale data). Number portion is not checked at all.
*
* @deprecated Use getIssue instead
* @param id String like MNG-1234
*/
@Deprecated
public boolean existsIssue(String id) {
int idx = id.indexOf('-');
if (idx == -1) {
Expand Down
15 changes: 3 additions & 12 deletions src/main/java/hudson/plugins/jira/Updater.java
Expand Up @@ -195,22 +195,13 @@ void submitComments(

}

private static List<JiraIssue> getJiraIssues(
Set<String> ids, JiraSession session, PrintStream logger) throws RemoteException {
private static List<JiraIssue> getJiraIssues(Set<String> ids, JiraSession session, PrintStream logger) throws RemoteException {
List<JiraIssue> issues = new ArrayList<JiraIssue>(ids.size());
for (String id : ids) {
if (!session.existsIssue(id)) {
if (debug) {
logger.println(id + " looked like a JIRA issue but it wasn't");
}
continue; // token looked like a JIRA issue but it's actually not.
}


Issue issue = session.getIssue(id);
if (issue == null) {
if (debug) {
logger.println(id + " issue doesn't exist in JIRA");
}
logger.println(id + " issue doesn't exist in JIRA");
continue;
}

Expand Down

0 comments on commit 1d1747f

Please sign in to comment.