Uploaded image for project: 'Modular Service Container'
  1. Modular Service Container
  2. MSC-35

SetMethodInjector<Object> cannot be built with a paramClass other than Object.class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.Beta5
    • 1.0.0.Beta4
    • None
    • None
    • Workaround Exists
    • Hide

      Change the type of paramType from Class<T> to Class<? extends T> in the constructor of SetMethodInjector.

      Show
      Change the type of paramType from Class<T> to Class<? extends T> in the constructor of SetMethodInjector.

      The paramType parameter of SetMethodInjector constructors should be of a ? extends T type instead of T, otherwise, we can't create a SetMethodInjector<Object> with a paramType different than Object.class (when using the direct type of classes in the signature instead of variables).
      This will force you to create always SetMethodInjector<T> whereas T is the paramtype, thus preventing one from calling ServiceBuilder.addDependency(ServiceName, Injector<Object>).

              flaviarnn Flavia Rainone
              flaviarnn Flavia Rainone
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: