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

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

    • 3975

      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.

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

              Created:
              Updated:
              Resolved: