Skip to content

Commit 1d2b00a

Browse files
author
Vincent Potucek
committed
Pull apache#2292: Modernize codebase with Java improvements - functionalize DefaultModelProcessor#read
1 parent 2279d78 commit 1d2b00a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelProcessor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,24 @@
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.)

0 commit comments

Comments
 (0)