Skip to content

Null pointer exception when using NumberColumn::setPrintFormatter function #1047

@hongwingl

Description

@hongwingl

When I use setPrintFormatter(NumberFormat format, String missingValueIndicator) function in NumberColumn class, I get a NPE when the table is written to file. The problem is that formatter.setColumnType(this.type()); is not called in this function variant.

Fix is to change the function definition to

public void setPrintFormatter(NumberFormat format, String missingValueIndicator) {
    setPrintFormatter(new NumberColumnFormatter(format, missingValueIndicator));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions