Skip to content

Cell#setValue with LocalDate instance mutates the style instance which can be a shared Style.default_style instance #101

@thestrox

Description

@thestrox

Hello,

There seem to be a bug in the Cell#setValue which mutates the Style.default_style instance if the style is untouched at that point.
This causes the Style.ISO_DATE_DATA_STYLE to be set on the Style.default_style instance shared by all cells. Then immediately upon next call to the Cell#setValue by any cell, the dataStyle is set to null as the style is the same shared Style.default_style instance.

So, basically the code is doing nothing if the style is untouched and still a Style.default_style instance at that point.
Also, it might be dangerous to mutate the shared instance like that.

I think the fix would be to modify the Cell#setValue for LocalDate by creating a new instance of style and setting it's dataStyle if the current style is Style.default_style.

SODS version 1.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions