Skip to content
Browse files

change List to Set

  • Loading branch information...
1 parent 9601595 commit daa3db71d1e3a896df73f056ab08efba3f54f57d @philandstuff committed Feb 3, 2011
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/main/com/thoughtworks/go/monitor/BuildStatusMonitor.java
View
11 src/main/com/thoughtworks/go/monitor/BuildStatusMonitor.java
@@ -53,8 +53,8 @@ public void pollForNewCompletion() {
void reportNewStage(Stage stage) {
visitedStages.add(stage.getStageLocator());
- List<String> users = checkinUsersForThisStage(stage);
- String user = users.get(0);
+ Set<String> users = checkinUsersForThisStage(stage);
+ String user = users.iterator().next();
for (BuildMonitorListener listener : listeners) {
if (isBroken(stage)) {
@@ -83,10 +83,9 @@ private boolean isBroken(Stage stage) {
return stage.getResult().equals("Failed");
}
- private List<String> checkinUsersForThisStage(Stage stage) {
- Pipeline pipeline = stage.getPipeline();
- List<String> users = new ArrayList<String>();
- for (Material material : pipeline.materials()) {
+ private Set<String> checkinUsersForThisStage(Stage stage) {
+ Set<String> users = new HashSet<String>();
+ for (Material material : stage.getPipeline().materials()) {
for (Material.Change change : material.getChanges()) {
users.add(change.getUser());
}

0 comments on commit daa3db7

Please sign in to comment.
Something went wrong with that request. Please try again.