Skip to content
Permalink
Browse files

[INFRA-100] - Do not rename components to existing names

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
  • Loading branch information
oleg-nenashev committed Jun 29, 2014
1 parent 1ab8354 commit 19bf9d907e7675968e194ed708431503620968d8
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/main/java/org/jenkinsci/jira_scraper/JiraScraper.java
@@ -65,6 +65,18 @@ public void renameComponent(String projectKey, String oldName, String newName)
BasicComponent c = getBasicComponent(projectKey, oldName);
Component comp = getComponent(c);

// Check the existance of the new component
BasicComponent newComponent = null;
try {
newComponent = getBasicComponent(projectKey, newName);
} catch (IOException cannotFindTheComponent) {
// All is OK
}
if (newComponent != null) {
throw new IOException("Unable to rename component " + oldName +
". Component " + newName + " already exists");
}

AssigneeInfo info = comp.getAssigneeInfo();
AssigneeType assigneeType = info != null ? info.getAssigneeType() : null;
BasicUser leadUser = info != null ? info.getAssignee() : null;

0 comments on commit 19bf9d9

Please sign in to comment.