Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6180

Add a Validator for NonNull configurations and remove redundant null checks on lists

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.10.1.0, 0.10.1.1, 0.10.2.0, 0.10.2.1, 0.11.0.0, 1.0.0
    • Fix Version/s: 1.1.0
    • Component/s: config
    • Labels:
      None

      Description

      AbstractConfig.getList returns null if the property is unset and there's no default.

      This creates a lot of cases where we need to do null checks (and remember them).
      It's good practice to just return an empty list as usually code naturally handles empty lists.

      To do this we set the default on lists to be Collections.emptyList() and add a Validator to disallow null values.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cmolter Charly Molter
                Reporter:
                cmolter Charly Molter
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: