Projects >> XCoLab >>358144ddc2b0c301161369f0e08904af991cba79

Chunk
Conflicting content
package com.ext.portlet.service.impl;

<<<<<<< HEAD
=======
import com.ext.portlet.NoSuchProposalContestPhaseAttributeException;
import com.ext.portlet.ProposalContestPhaseAttributeKeys;
>>>>>>> d99edd8ff716b1d8307b46bfafd14ce1c88c429d
import com.ext.portlet.model.Contest;
import com.ext.portlet.model.PointDistributionTarget;
import com.ext.portlet.model.PointType;
Solution content
package com.ext.portlet.service.impl;

import com.ext.portlet.NoSuchProposalContestPhaseAttributeException;
import com.ext.portlet.ProposalContestPhaseAttributeKeys;
import com.ext.portlet.model.Contest;
import com.ext.portlet.model.ContestPhase;
import com.ext.portlet.model.PointDistributionTarget;
import com.ext.portlet.model.PointType;
File
PointsLocalServiceImpl.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
import java.util.ArrayList;
import java.util.Collection;
<<<<<<< HEAD
import java.util.HashSet;
import java.util.List;
import java.util.Set;
=======
import java.util.List;
>>>>>>> d99edd8ff716b1d8307b46bfafd14ce1c88c429d

/**
 * The implementation of the points local service.
Solution content
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
 * The implementation of the points local service.
File
PointsLocalServiceImpl.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    }

    /**
     *
     * Returns number of points for hypothetical user.
        return Xcolab_UserFinderUtil.getUserMaterializedPoints(userId).intValue();
	
	private final static Log _log = LogFactoryUtil.getLog(PointsLocalServiceImpl.class);

<<<<<<< HEAD
    /**
     * Returns number of materialized points for given user.
     *
     * @throws SystemException
     */
    public int getUserMaterializedPoints(long userId) throws SystemException {
     * @throws SystemException
     */
    public long getUserHypotheticalPoints(long userId) throws SystemException {
=======
	/**
	 * Returns number of materialized points for given user.
	 *
	 * @throws SystemException
	 */
	public int getUserMaterializedPoints(long userId) throws SystemException {
		return Xcolab_UserFinderUtil.getUserMaterializedPoints(userId).intValue();
	}
	
	/**
	 * Returns number of points for hypothetical user. 
	 *
	 * @throws SystemException
	 */
	public long getUserHypotheticalPoints(long userId) throws SystemException {
>>>>>>> d99edd8ff716b1d8307b46bfafd14ce1c88c429d
        return Xcolab_UserFinderUtil.getUserHypotheticalPoints(userId).intValue();
	}
	
Solution content
	 *
	
	private final static Log _log = LogFactoryUtil.getLog(PointsLocalServiceImpl.class);


	/**
	 * Returns number of materialized points for given user.
	 *
	 * @throws SystemException
	 */
	public int getUserMaterializedPoints(long userId) throws SystemException {
		return Xcolab_UserFinderUtil.getUserMaterializedPoints(userId).intValue();
	}
	
	/**
	 * Returns number of points for hypothetical user. 
	 * @throws SystemException
	 */
	public long getUserHypotheticalPoints(long userId) throws SystemException {
        return Xcolab_UserFinderUtil.getUserHypotheticalPoints(userId).intValue();
	}
	
File
PointsLocalServiceImpl.java
Developer's decision
Version 1
Kind of conflict
Comment
Method declaration
Method signature
Chunk
Conflicting content
        return materializedPointsList;
	}

<<<<<<< HEAD
    public List getLinkingProposals(long proposalId) throws SystemException, PortalException {
        List linkingProposals = new ArrayList<>();
        final List linkingPoints = pointsPersistence.findByProposalId(proposalId);
        for (Points points : linkingPoints) {
            final long originatingProposalId = points.getOriginatingProposalId();
            final Proposal proposal = proposalLocalService.getProposal(originatingProposalId);
            if (!linkingProposals.contains(proposal)) {
                linkingProposals.add(proposal);
            }
        }
        return linkingProposals;
=======
    private boolean proposalIsHidden(Proposal proposal, Contest contest) throws SystemException, PortalException {
        if (!proposal.isVisible())
            return true;
        try {
            final ContestPhase activePhase = contestPhaseLocalService.getActivePhaseForContest(contest);
            final ProposalContestPhaseAttribute visibleAttribute = proposalContestPhaseAttributeLocalService.getProposalContestPhaseAttribute(
                    proposal.getProposalId(), activePhase.getContestPhasePK(), ProposalContestPhaseAttributeKeys.VISIBLE);
            if (visibleAttribute.getNumericValue() == 0) {
                return true;
            }
        } catch (NoSuchProposalContestPhaseAttributeException ignored) { }
        return false;
>>>>>>> d99edd8ff716b1d8307b46bfafd14ce1c88c429d
    }
}
Solution content
        return materializedPointsList;
	}

    public List getLinkingProposals(long proposalId) throws SystemException, PortalException {
        List linkingProposals = new ArrayList<>();
        final List linkingPoints = pointsPersistence.findByProposalId(proposalId);
        for (Points points : linkingPoints) {
            final long originatingProposalId = points.getOriginatingProposalId();
            final Proposal proposal = proposalLocalService.getProposal(originatingProposalId);
            if (!linkingProposals.contains(proposal)) {
                linkingProposals.add(proposal);
            }
        }
        return linkingProposals;
    }

    private boolean proposalIsHidden(Proposal proposal, Contest contest) throws SystemException, PortalException {
        if (!proposal.isVisible())
            return true;
        try {
            final ContestPhase activePhase = contestPhaseLocalService.getActivePhaseForContest(contest);
            final ProposalContestPhaseAttribute visibleAttribute = proposalContestPhaseAttributeLocalService.getProposalContestPhaseAttribute(
                    proposal.getProposalId(), activePhase.getContestPhasePK(), ProposalContestPhaseAttributeKeys.VISIBLE);
            if (visibleAttribute.getNumericValue() == 0) {
                return true;
            }
        } catch (NoSuchProposalContestPhaseAttributeException ignored) {
        }
        return false;
    }
}
File
PointsLocalServiceImpl.java
Developer's decision
Concatenation
Kind of conflict
If statement
Method signature
Return statement
Try statement