This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 0afdf5d7fb4f4d8d0b3f1320b5a22106936648ca Author: Dralagen <dralagen@dralagen.fr> Date: Wed Oct 22 17:59:44 2014 +0200 Improve list of voteCounting, no depend of voteCounting id --- .../services/service/VoteCountingTypeService.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteCountingTypeService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteCountingTypeService.java index 554ba2c..7425b84 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteCountingTypeService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteCountingTypeService.java @@ -28,6 +28,7 @@ import org.chorem.pollen.votecounting.VoteCountingNotFound; import org.chorem.pollen.votecounting.VoteCountingStrategy; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -40,21 +41,15 @@ import java.util.Locale; public class VoteCountingTypeService extends PollenServiceSupport { public List<VoteCountingTypeBean> getVoteCountingTypes() { + + VoteCountingFactory factory = serviceContext.getVoteCountingFactory(); + List<VoteCountingTypeBean> voteCountingTypes = new ArrayList<VoteCountingTypeBean>(); - try { - int i = 1; - while ( i > 0 ) { + for ( VoteCounting voteCounting : factory ) { - voteCountingTypes.add(idToVoteCountingType(i)); + voteCountingTypes.add(idToVoteCountingType(voteCounting.getId())); - ++i; - } - } - catch (VoteCountingNotFound e) { - if (voteCountingTypes.size() == 0) { - throw e; - } } return voteCountingTypes; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.