You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Exporter there is the constructor with one argument - Container container. This calls the constructor with two arguments - Container container, Object[] visibleColumns , with null value for visibleColumns. In this constructor, the call this.setContainerToBeExported(container) , eventually creates the FileBuilder and ends up in the setContainer(container) method which also set's the visibleColumns. Then in the same constructor you set again the visibleColumns, to null this time, because it is the value passed in as parameter.
This leads to NPE in FileBuilder in methods like buildColumnHeaders, where you check the length on the visibleColumns array which is in fact null - if (this.visibleColumns.length != 0) .
My solution:
public Exporter(Container container, Object[] visibleColumns) {
this();
this.setCaption("Exporter");
//set visible columns first
this.setVisibleColumns(visibleColumns);
//then, the container
this.setContainerToBeExported(container);
}
The text was updated successfully, but these errors were encountered:
In Exporter there is the constructor with one argument - Container container. This calls the constructor with two arguments - Container container, Object[] visibleColumns , with null value for visibleColumns. In this constructor, the call this.setContainerToBeExported(container) , eventually creates the FileBuilder and ends up in the setContainer(container) method which also set's the visibleColumns. Then in the same constructor you set again the visibleColumns, to null this time, because it is the value passed in as parameter.
This leads to NPE in FileBuilder in methods like buildColumnHeaders, where you check the length on the visibleColumns array which is in fact null - if (this.visibleColumns.length != 0) .
My solution:
The text was updated successfully, but these errors were encountered: