noi-techpark / bdp-core

Open Data Hub / Timeseries Core
https://opendatahub.com
Other
9 stars 4 forks source link

dal/MeasurementStringHistory.java #189

Closed mwallnoefer closed 3 years ago

mwallnoefer commented 3 years ago

https://github.com/noi-techpark/bdp-core/blob/a6c8cc9be39c846aa3f2e0cf827ac36b8e2c4214/dal/src/main/java/it/bz/idm/bdp/dal/MeasurementStringHistory.java#L119

could better be converted into the following to avoid a potential null pointer dereference:

    @Override
    public void setValue(Object value) {
        if (value instanceof String)
            this.stringValue = (String) value;
    }
mwallnoefer commented 3 years ago

Any news on this?

bertolla commented 3 years ago

The null check should be done here for sure, but since every object implements the toString method we would like to avoid typechecking and prefer to keep it that way. Thanks for your contribution

mwallnoefer commented 3 years ago

Ok, fine