Konrad Windszus created SLING-12986:
---------------------------------------

             Summary: Models: Support constructor injection without @Inject 
annotation on method level
                 Key: SLING-12986
                 URL: https://issues.apache.org/jira/browse/SLING-12986
             Project: Sling
          Issue Type: Improvement
          Components: Sling Models
            Reporter: Konrad Windszus


Currently it is mandatory to use the `javax.inject.Inject` annotation on the 
constructor when using constructor injection: 
https://github.com/apache/sling-org-apache-sling-models-impl/blob/a42cb661dff6da2df612470d0b9d95a2cdd39f9e/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java#L819.
 
I think this limitation should be lifted and the constructor with most 
arguments (annotated with some injector-specific annotations or Inject 
annotation) should be used even if it lacks the method level Inject annotation.

This is particularly useful as the import on java.inject caused quite some 
issues in the past and also is supposed to be moved to another package 
(SLING-12886).





--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to