noi-techpark / bdp-core

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

dal/Measurement.java - dead code #188

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/Measurement.java#L116

lines 116 and 117 are superfluous since a Double matches also a Number. As an alternative the code could be swapped to gain the type optimisation without calling doubleValue():

    @Override
    public void setValue(Object value) {
        if (value instanceof Double) {
            this.doubleValue = (Double) value;
        } else if (value instanceof Number) {
            this.doubleValue = ((Number) value).doubleValue();
        }
    }
mwallnoefer commented 3 years ago

Any news on this?

bertolla commented 3 years ago

Hi Matthias, thanks for the input. We'll try to incorporate these changes in the next release. Feel free to open a pull request, so that the changes are attributed to the right person. In general we appreciate code contributions.

mwallnoefer commented 3 years ago

PR #198