gnodet-bot commented on code in PR #13312:
URL: https://github.com/apache/maven/pull/13312#discussion_r4153047385
##########
impl/maven-core/src/main/java/org/apache/maven/plugin/PluginRealmCache.java:
##########
@@ -48,13 +49,28 @@ public List<Artifact> getArtifacts() {
return artifacts;
}
+ /**
+ * Resolver node captured when the realm was created. {@code null}
when the realm was cached
+ * before the node was recorded.
+ */
+ public DependencyNode getDependencyNode() {
+ return dependencyNode;
+ }
+
private final ClassRealm realm;
private final List<Artifact> artifacts;
+ private final DependencyNode dependencyNode;
+
Review Comment:
The default `get(Key, PluginRealmSupplier)` method (unchanged, lines 99-107)
calls `put(key, tcr.getRealm(), tcr.getArtifacts())`, which creates a new
`CacheRecord` via the 2-arg constructor and sets `dependencyNode = null`.
`DefaultPluginRealmCache` overrides this method with `computeIfAbsent` so the
standard path works, but custom `PluginRealmCache` implementations (IDE
integrations, Takari lifecycle extension, etc.) inheriting the default method
will silently drop the node on cache miss.
Not a blocker since the in-tree implementation works correctly, but worth a
follow-up to update the default method or `put()` signature.
--
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]