Skip to content

Commit

Permalink
SAK-31957 Don't NPE when announcements sorted by user. (sakaiproject#…
Browse files Browse the repository at this point in the history
…3613)

* SAK-31957 Add Generics to MessageChannel interface

This makes it easier to add generics to classes that implement these interfaces and so check that our types are correct.

* SAK-31957 Added generics the to AnnouncementChannel

This makes it easier to see what types the calls should be returning.

* SAK-31957 Don’t fail on sorting with deleted users.

If a site has an announcement made by a user who is now deleted then attempting to sort by the author results in an error as the anonymous
user doesn’t have a sort name.

Refactor comparator into it’s own class.
This also refactors out the group comparator into it's own one, so the
comparators can be type safe.
Also removed sortbygrouptitle and sortbygroupdescription as there is
not use of these options and they were resulting in the comparators not using stricter types.
  • Loading branch information
buckett authored and ottenhoff committed Nov 28, 2016
1 parent cb4af54 commit e06c80b
Show file tree
Hide file tree
Showing 9 changed files with 323 additions and 346 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* AnnouncementChannel is the extension to the MessageChanel interface for a Sakai Announcement service announcement channel.
* </p>
*/
public interface AnnouncementChannel extends MessageChannel
public interface AnnouncementChannel<T extends AnnouncementMessage> extends MessageChannel<T>
{
/**
* A (AnnouncementMessage) cover for getMessage to return a specific announcement channel message, as specified by message id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
* AnnouncementChannelEdit is an editable AnnouncementChannel.
* </p>
*/
public interface AnnouncementChannelEdit extends AnnouncementChannel, MessageChannelEdit
public interface AnnouncementChannelEdit extends AnnouncementChannel<AnnouncementMessageEdit>, MessageChannelEdit<AnnouncementMessageEdit>
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ public void updateEntityReferences(String toContext, Map<String, String> transve
* AnnouncementChannel implementation
*********************************************************************************************************************************************************************************************************************************************************/

public class BaseAnnouncementChannelEdit extends BaseMessageChannelEdit implements AnnouncementChannelEdit
public class BaseAnnouncementChannelEdit extends BaseMessageChannelEdit<AnnouncementMessageEdit> implements AnnouncementChannelEdit
{
/**
* Construct with a reference.
Expand Down
Loading

0 comments on commit e06c80b

Please sign in to comment.