PDA

View Full Version : [FIXED] [1.2.3] PortalEvent constructor does not set the Portal



The_Jackal
13 Apr 2009, 4:57 PM
Hi,

The second PortalEvent constructor does not set the Portal member. This can cause a null pointer when using a the portal member of a PortalEvent.

The code for the second constructor should call this(portal) not super(portal).

The original code is here:



public PortalEvent(Portal portal) {
super(portal);
this.portal = portal;
}

public PortalEvent(Portal portal, Portlet portlet, int startColumn, int startRow, int column,
int row) {
super(portal);
this.portlet = portlet;
this.startColumn = startColumn;
this.startRow = startRow;
this.column = column;
this.row = row;
}
The code for the second constructor should be:



public PortalEvent(Portal portal, Portlet portlet, int startColumn, int startRow, int column,
int row) {
this(portal);
this.portlet = portlet;
this.startColumn = startColumn;
this.startRow = startRow;
this.column = column;
this.row = row;
}
Regards,
The_Jackal

sven
14 Apr 2009, 10:49 AM
Fixed in SVN.