gnodet-bot commented on code in PR #14175:
URL: https://github.com/apache/maven/pull/14175#discussion_r4731522881
##########
impl/maven-di/src/main/java/org/apache/maven/di/Injector.java:
##########
@@ -53,6 +53,16 @@
*/
public interface Injector {
+ /**
+ * Priority assigned to session services injected by Maven core into V4
mojos.
+ * <p>
+ * A negative value ensures that these fallback bindings are overridden by
any
+ * plugin-provided {@code @Provides} method (which defaults to priority
{@code 0}).
+ *
+ * @since 4.2.0
Review Comment:
⚠️ **Wrong `@since` for a `maven-4.0.x` backport.**
`SESSION_SERVICE_PRIORITY` first becomes available to users in a 4.0.0 release,
which ships before 4.2.0. Per apache/maven convention, `@since` = first version
available to users. The PR description even anticipated this: "I can change the
tag to 4.0.0 if you prefer" — yes, please do.
```suggestion
* @since 4.0.0
```
##########
impl/maven-di/src/main/java/org/apache/maven/di/Injector.java:
##########
@@ -147,6 +157,32 @@ static Injector create() {
@Nonnull
<T> Injector bindSupplier(@Nonnull Class<T> cls, @Nonnull Supplier<T>
supplier);
+ /**
+ * Binds a supplier to a class with an explicit priority.
+ * <p>
+ * A lower priority value means the binding will be overridden by any
binding with a higher priority.
+ * Use a negative priority (e.g. {@code -10}) to register a fallback
binding that yields to
+ * plugin-provided {@code @Provides} methods (which default to priority
{@code 0}).
+ *
+ * <p>
+ * <b>Implementation note:</b> The default implementation ignores {@code
priority} for
+ * backward compatibility with existing {@code Injector} implementations.
+ * Implementors SHOULD override this method to honor the priority
parameter.
+ * </p>
+ *
+ * @param <T> the type of the instance
+ * @param cls the class to bind to
+ * @param supplier the supplier to use for injection
+ * @param priority the binding priority
+ * @return this injector instance for method chaining
+ * @throws NullPointerException if {@code cls} or {@code supplier} is null
Review Comment:
⚠️ **Same `@since` issue** — `bindSupplier(Class, Supplier, int)` is added
to the `maven-4.0.x` branch, so users will first encounter it in a 4.0.0
release, not 4.2.0.
```suggestion
* @since 4.0.0
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]