ikxeno commented on code in PR #13602:
URL: https://github.com/apache/maven/pull/13602#discussion_r4304919135
##########
impl/maven-di/src/main/java/org/apache/maven/di/impl/InjectorImpl.java:
##########
@@ -515,6 +561,91 @@ public T get() {
}
}
+ /**
+ * Captures a human-readable snapshot of the current native registry for
Maven internals,
+ * including direct binding map and metadata changes, without resolving
components.
+ * Registration must not run concurrently with this method.
+ */
+ public String dumpBindings() {
+ return BindingSnapshot.render(
+ this, registryRevision, "explicit", false,
BindingSnapshot.capture(bindings, scopes));
+ }
+
+ /** Diagnostic checkpoint for native and bridge resolution entry points. */
+ protected final void debugBindings() {
+ debugBindings("lookup", false);
+ }
+
+ private void debugBindings(String reason, boolean partial) {
+ if (!debugEnabled()) {
+ if (diagnosticState != null) {
+ synchronized (diagnosticLock) {
+ diagnosticState = null;
+ }
+ }
+ return;
+ }
+ PrintStream output = System.out;
+ DiagnosticState state = diagnosticState;
+ if (!partial && state != null && state.capturedRevision ==
registryRevision && state.output.get() == output) {
+ return;
+ }
+ writeBindings(output, reason, partial);
+ }
+
+ private static boolean debugEnabled() {
+ try {
+ String property = System.getProperty("sisu.debug");
Review Comment:
On OpenJDK
[17](https://github.com/openjdk/jdk17u/blob/master/src/java.base/share/classes/java/util/Properties.java#L1101-L1106),
[21](https://github.com/openjdk/jdk21u/blob/master/src/java.base/share/classes/java/util/Properties.java#L1146-L1151),
and
[25](https://github.com/openjdk/jdk25u/blob/master/src/java.base/share/classes/java/util/Properties.java#L1144-L1149),
`Properties.getProperty()` reads a `ConcurrentHashMap` without taking the
properties monitor, so the global-monitor claim is incorrect. I verified the
same behavior on Eclipse Temurin 17 and Oracle JDK 21/25.
--
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]