jira-integration: Use Collections.unmodifiableList in JiraSyncInfo

In order to simply code of JiraSyncInfo it has been used the method
Collections.unmodifiableList. Moreover, the type of syncFailedReasons has been
changed to List to make it easier.

FEA: ItEr77S16JiraAndTimConnectorContributionIntegration
This commit is contained in:
Manuel Rego Casasnovas 2013-01-30 11:45:45 +01:00
parent 50ab6fee37
commit e1bf121b4c

View file

@ -20,9 +20,8 @@
package org.libreplan.importers;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Collections;
import java.util.List;
import java.util.Set;
/**
* Keeps track the synchronization info.
@ -31,7 +30,7 @@ import java.util.Set;
*/
public class JiraSyncInfo {
private Set<String> syncFailedReasons = new HashSet<String>();
private List<String> syncFailedReasons = new ArrayList<String>();
/**
* Add the specified <code>reason</code> to syncFailedReasons list
@ -56,9 +55,7 @@ public class JiraSyncInfo {
* returns reasons why synchronization is failed
*/
public List<String> getSyncFailedReasons() {
List<String> failedReasons = new ArrayList<String>();
failedReasons.addAll(syncFailedReasons);
return failedReasons;
return Collections.unmodifiableList(syncFailedReasons);
}
}