GitHub user jerrypeng opened a pull request:
https://github.com/apache/storm/pull/658
STORM-966 ConfigValidation.DoubleValidator is misleading and not neccessary
ConfigValidation.DoubleValidator doesn't really validate whether the type
of the object is a double.
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 thus the validator function doesn't really do anything and the
name is misleading. In previous commit
https://github.com/apache/storm/commit/214ee7454548b884c591991b1faea770d1478cec
Number.Class was used anyway
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jerrypeng/storm master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/658.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #658
----
commit db503a4576499f4fd89ea9566b14fdc7ade0b5a4
Author: Jerry <jerry@ubuntu.(none)>
Date: 2015-07-30T04:00:49Z
STORM-966 ConfigValidation.DoubleValidator doesn't really validate whether
the type of the object is a double
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---