You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "Boyang Jerry Peng (JIRA)" <ji...@apache.org> on 2015/07/30 05:42:04 UTC

[jira] [Updated] (STORM-966) ConfigValidation.DoubleValidator doesn't really validate whether the type of the object is a double

     [ https://issues.apache.org/jira/browse/STORM-966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boyang Jerry Peng updated STORM-966:
------------------------------------
    Description: 
ConfigValidation.DoubleValidator code only checks if the object is null whether if the object is a instance of Number which is a parent class of Double.

DoubleValidator is only used once in Config.java and in that instance:

public static final Object TOPOLOGY_STATS_SAMPLE_RATE_SCHEMA = ConfigValidation.DoubleValidator;

can just be set to:

public static final Object TOPOLOGY_STATS_SAMPLE_RATE_SCHEMA = NUMBER.class;

Then we can just get rid of the misleading function ConfigValidation.DoubleValidator since it doesn't really check if a object is of double type. 




  was:
ConfigValidation.DoubleValidator code only checks if the object is null whether if the object is a instance of Number which is a parent class of Double.

DoubleValidator is only used once in Config.java and in that instance:

public static final Object TOPOLOGY_STATS_SAMPLE_RATE_SCHEMA = ConfigValidation.DoubleValidator;

can just be set to:

public static final Object TOPOLOGY_STATS_SAMPLE_RATE_SCHEMA = Double.class;

Then we can just get rid of the misleading function ConfigValidation.DoubleValidator since it doesn't really check if a object is of double type




> ConfigValidation.DoubleValidator doesn't really validate whether the type of the object is a double
> ---------------------------------------------------------------------------------------------------
>
>                 Key: STORM-966
>                 URL: https://issues.apache.org/jira/browse/STORM-966
>             Project: Apache Storm
>          Issue Type: Improvement
>            Reporter: Boyang Jerry Peng
>            Assignee: Boyang Jerry Peng
>            Priority: Minor
>
> ConfigValidation.DoubleValidator code only checks if the object is null whether if the object is a instance of Number which is a parent class of Double.
> DoubleValidator is only used once in Config.java and in that instance:
> public static final Object TOPOLOGY_STATS_SAMPLE_RATE_SCHEMA = ConfigValidation.DoubleValidator;
> can just be set to:
> public static final Object TOPOLOGY_STATS_SAMPLE_RATE_SCHEMA = NUMBER.class;
> Then we can just get rid of the misleading function ConfigValidation.DoubleValidator since it doesn't really check if a object is of double type. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)