File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
impl/maven-impl/src/main/java/org/apache/maven/impl/model Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 4444/**
4545 *
4646 * Note: uses @Typed to limit the types it is available for injection to just ModelProcessor.
47- * <p>
47+ *
4848 * This is because the ModelProcessor interface extends ModelLocator and ModelReader. If we
4949 * made this component available under all its interfaces then it could end up being injected
5050 * into itself leading to a stack overflow.
51- * <p>
51+ *
5252 * A side effect of using @Typed is that it translates to explicit bindings in the container.
5353 * So instead of binding the component under a 'wildcard' key it is now bound with an explicit
5454 * key. Since this is a default component; this will be a plain binding of ModelProcessor to
5555 * this implementation type; that is, no hint/name.
56- * <p>
56+ *
5757 * This leads to a second side effect in that any @Inject request for just ModelProcessor in
5858 * the same injector is immediately matched to this explicit binding, which means extensions
5959 * cannot override this binding. This is because the lookup is always short-circuited in this
6060 * specific situation (plain @Inject request, and plain explicit binding for the same type.)
61- * <p>
61+ *
6262 * The simplest solution is to use a custom @Named here so it isn't bound under the plain key.
6363 * This is only necessary for default components using @Typed that want to support overriding.
64- * <p>
64+ *
6565 * As a non-default component this now gets a negative priority relative to other implementations
6666 * of the same interface. Since we want to allow overriding this doesn't matter in this case.
6767 * (if it did we could add @Priority of 0 to match the priority given to default components.)
You can’t perform that action at this time.
0 commit comments