gnodet-bot commented on code in PR #13471:
URL: https://github.com/apache/maven/pull/13471#discussion_r4261844500
##########
impl/maven-di/src/main/java/org/apache/maven/di/impl/Binding.java:
##########
@@ -116,7 +138,15 @@ public Supplier<T> compile(Function<Dependency<?>,
Supplier<?>> compiler) {
@Override
public String toString() {
- return Binding.this.toString();
+ return Binding.this
+ + (registrationIdentity == null
+ ? " initialized by " +
identityString(bindingInitializer)
+ : " (initialized)");
+ }
Review Comment:
⚠️ **Asymmetric `toString()` output** — the `registrationIdentity == null`
branch identifies the initializer via `identityString(bindingInitializer)`, but
the `!= null` branch outputs only `" (initialized)"` with no identifying info.
When `registrationIdentity` is set, you lose the initializer identity from the
string representation.
```suggestion
public String toString() {
return Binding.this
+ (registrationIdentity == null
? " initialized by " +
identityString(bindingInitializer)
: " initialized via " + registrationIdentity);
}
```
--
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]