private Set<Label> setIfNotEqual(final Issue issue, final Set<String> labels, final Long customFieldId,
final ApplicationUser remoteUser, final boolean sendNotification,final boolean causesChangeNotification)
{
Set<Label> oldLabels = labelStore.getLabels(issue.getId(), customFieldId);
if (differentLabels(labels, oldLabels)) {
final Set<Label> newLabels = labelStore.setLabels(issue.getId(), customFieldId, labels);
if (causesChangeNotification)
{
issueUpdated(newLabels, oldLabels, issue, customFieldId, remoteUser, sendNotification);
}
return newLabels;
} else {
return oldLabels;
}
}