Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-1390

The config module API does not make it clear what exactly needs to be returned by createInstance

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Won't Do
    • Lithium
    • None
    • config
    • None
    • Operating System: All
      Platform: All

    • 3975

    Description

      The current API for createInstance is as follows,

      java.lang.AutoCloseable createInstance();

      The problem with this is that when a module provides services a developer may not return an appropriate implementation of the services it provides. The error can then only be detected at runtime.

      One suggestion from rovarga is to change the API as follows,

      <T extends InterfaceA & InterfaceB & AutoClosable> T createInstance();

      which forces the developer to return an appropriate implementation.

      This also clarifies how exactly a module is supposed to provide multiple services.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            moraja@cisco.com Moiz Raja
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: