Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-966

ConfigValidation.DoubleValidator doesn't really validate whether the type of the object is a double

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.10.0
    • storm-core
    • None

    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 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

      Attachments

        Activity

          People

            jerrypeng Boyang Jerry Peng
            jerrypeng Boyang Jerry Peng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: