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

Make Timer.java implement AutoCloseable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.6.0
    • core

    Description

      Many automatic bug finders will flag a warning if an object of class which is marked as AutoCloseable but is not closed properly in the code. Hence, as a best practice we should implement AutoCloseable for classes which require resources to be released after shutdown.

      Timer.java should implement AutoCloseable and ShutDown should be replaced with close() method.

      Note that this interface change does not require a KIP since Timer.java is not a user facing public class.

      This was discussed here: https://github.com/apache/kafka/pull/13820#discussion_r1222654614 

      Attachments

        Issue Links

          Activity

            People

              joobi Joobi S B
              divijvaidya Divij Vaidya
              Divij Vaidya Divij Vaidya
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: