Apache MyFaces
UI-Component Sets
MyFaces Orchestra
Foundation

CPD Results

The following document contains the results of PMD's CPD 4.2.5.

Duplications

FileLine
org/apache/myfaces/examples/ballot/backings/BallotTopicVotes.java242
org/apache/myfaces/examples/ballot/backings/BallotVoteTopic.java249
        Voter voter = voterDao.getByKey(getBallotState().getVoterId());

        Map<Item, Vote> voteMap = new HashMap<Item, Vote>();
        for (Vote vote : voteDao.getVotesForVoter(voter))
        {
            voteMap.put(vote.getItem(), vote);
        }

        Map<Item, Long> itemVotes = itemDao.getItemVoteSumForTopic(getTopic());

        for (Item item : getTopic().getItems())
        {
            Vote vote = voteMap.get(item);
            if (vote == null)
            {
                vote = new Vote();
                vote.setItem(item);
                vote.setVoter(voter);
            }
            itemInfos.add(new ItemInfo(item, vote, itemVotes.get(item)));
        }

        return itemInfos;
FileLine
org/apache/myfaces/examples/ballot/backings/BallotTopicVotes.java106
org/apache/myfaces/examples/ballot/backings/BallotVoteTopic.java131
    }

    public BallotState getBallotState()
    {
        return ballotState;
    }

    public void setBallotState(BallotState ballotState)
    {
        this.ballotState = ballotState;
    }

    public TopicDao getTopicDao()
    {
        return topicDao;
    }

    public void setTopicDao(TopicDao topicDao)
    {
        this.topicDao = topicDao;
    }

    public VoteDao getVoteDao()
    {
        return voteDao;
    }

    public void setVoteDao(VoteDao voteDao)
    {
        this.voteDao = voteDao;
    }

    public ItemDao getItemDao()
    {
        return itemDao;
    }

    public void setItemDao(ItemDao itemDao)
    {
        this.itemDao = itemDao;
    }

    public VoterDao getVoterDao()
    {
        return voterDao;
    }

    public void setVoterDao(VoterDao voterDao)
    {
        this.voterDao = voterDao;
    }

    public void initView()