Skip to content

Commit

Permalink
Update ProjectSelections.java
Browse files Browse the repository at this point in the history
  • Loading branch information
pberlandier committed Aug 31, 2020
1 parent 7f4b717 commit edbd0b0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions ota-driver/src/com/ibm/odm/ota/ProjectSelections.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ public ProjectSelections(String projectSelectionsString) throws OTAException {
this.selections = getSelectedItems(projectSelectionsString);
}

/**
* Returns an iterator on all selected project/branch items.
* @return
*/
public Iterator<Item> getSelections() {
return selections.iterator();
}

/**
* Return true if the given project name is selected for analysis.
*
Expand Down Expand Up @@ -119,9 +123,15 @@ protected List<Item> getSelectedItems(String projectSelectionsString) throws OTA
branchName = null;
}
try {
selections.add(new Item(IlrSessionHelper.getProjectNamed(session, projectName), branchName));
IlrRuleProject project = IlrSessionHelper.getProjectNamed(session, projectName);
if ( project == null ) {
throw new OTAException("Invalid rule project name: " + projectName);
}
else {
selections.add(new Item(project, branchName));
}
} catch (IlrObjectNotFoundException e) {
throw new OTAException("Invalid project name: " + projectName);
throw new OTAException("Invalid rule project name: " + projectName);
}
}
}
Expand Down

0 comments on commit edbd0b0

Please sign in to comment.