PureMVC Architects Lounge

PureMVC Manifold => Bug Report => Topic started by: Kevin Kirkup on June 09, 2010, 06:39:11



Title: [FIXED] Mediator Class: listNotificationInterests returns null
Post by: Kevin Kirkup on June 09, 2010, 06:39:11
In the base Mediator class, the listNotificiationInterests method returns 'null' by default.
:
public String[] listNotificationInterests( )
{
return null;
}

If you try to create a Mediator subclass and don't implement a listNotificationsInterests method, you will get a NullPointer exception because it is being referenced in registerMediator method of the View Class.
:
// Get Notification interests, if any.
String[] noteInterests = mediator.listNotificationInterests();
if (noteInterests.length == 0) {
return;
}

I think the default listNotificationsInterests should probably return a new String[] instead.

Thoughts?


Title: Re: Mediator Class: listNotificationInterests returns null
Post by: puremvc on June 09, 2010, 05:19:24
Absolutely it should. This is what the AS3 reference does - it returns an empty array. Don't know how the Java Standard port missed this. It's in the MultiCore port:

:
/**
* List the <code>INotification</code> names this <code>Mediator</code>
* is interested in being notified of.
*
* @return String[] the list of <code>INotification</code> names
*/
public String[] listNotificationInterests( )
{
return new String[]{};
}

BTW, in the meantime, I would suggest using the multicore port if possible.

-=Cliff>