diff --git a/plugins/src/main/java/io/github/rawvoid/jaxb/plugin/DedupeClassPlugin.java b/plugins/src/main/java/io/github/rawvoid/jaxb/plugin/DedupeClassPlugin.java index fca2b9c..d6394d7 100644 --- a/plugins/src/main/java/io/github/rawvoid/jaxb/plugin/DedupeClassPlugin.java +++ b/plugins/src/main/java/io/github/rawvoid/jaxb/plugin/DedupeClassPlugin.java @@ -93,6 +93,12 @@ * Shell-to-shell exact merges remain allowed. Default is auto: on when * {@code -Xelement-wrapper} is also active; force with {@code true}/{@code false}. *
+ *+ * Logging: each accepted merge is {@code DEBUG}; merge and element-class-clear counts are + * {@code INFO}. Routine skips stay {@code DEBUG}; element-class root mismatches and + * ObjectFactory collisions after dedupe are {@code WARN} (ObjectFactory: one multi-line + * summary). + *
* * @author Rawvoid */ @@ -869,7 +875,11 @@ public void postProcessModel(Model model, ErrorHandler errorHandler) { warnObjectFactoryCollisions(model); } if (merged > 0) { - log.info("Deduped {} bean merge(s){}", merged, session.dry ? " (dry-run)" : ""); + if (session.dry) { + log.info("Deduped {} bean merge(s) (dry-run)", merged); + } else { + log.info("Deduped {} bean merge(s)", merged); + } } } @@ -1019,7 +1029,7 @@ private boolean tryMerge( if (!isPackageLevel(host) && host.parent() != victim.parent() && !allowCrossNestedParent) { log.debug( - "Skip dedupe {}: cross-hierarchy nested '{}' vs '{}'", + "Skip dedupe {}: cross-hierarchy nested {} vs {}", reason, victim.fullName(), host.fullName() ); return false; @@ -1028,11 +1038,11 @@ private boolean tryMerge( if (victim.isElement() && host.isElement() && !Objects.equals(victim.getElementName(), host.getElementName())) { log.warn( - "Skip dedupe {}: both '{}' and '{}' are element-classes with different roots ({} vs {})", + "Skip dedupe {}: both element-classes with different roots: {} ({}) vs {} ({})", reason, victim.fullName(), - host.fullName(), victim.getElementName(), + host.fullName(), host.getElementName() ); return false; @@ -1044,7 +1054,7 @@ private boolean tryMerge( && ModelUtils.isPureCollectionShell(victim) && !ModelUtils.isPureCollectionShell(host)) { log.debug( - "Skip dedupe {}: pure collection shell '{}' must not merge into non-shell '{}'", + "Skip dedupe {}: pure collection shell {} must not merge into non-shell {}", reason, victim.fullName(), host.fullName() ); return false; @@ -1057,8 +1067,8 @@ private boolean tryMerge( return false; } - log.info( - "Dedupe {}: '{}' -> '{}' (nameKey={})", + log.debug( + "Dedupe {}: {} → {} (nameKey={})", reason, victim.fullName(), host.fullName(), nameKey(victim.shortName) ); @@ -1102,7 +1112,11 @@ private boolean prepareNestedMerges(Model model, Session session, CClassInfo vic var childNorm = child.shortName.toLowerCase(Locale.ROOT); for (var hc : directNestedBeans(model, host)) { if (hc.shortName.toLowerCase(Locale.ROOT).equals(childNorm)) { - log.debug("Skip dedupe: nested name clash {} under {}", child.shortName, host.fullName()); + log.debug( + "Skip dedupe: nested name clash {} under {}", + child.shortName, + host.fullName() + ); return false; } } @@ -1165,9 +1179,10 @@ private boolean prepareNestedEnums(Model model, Session session, CClassInfo vict } } if (match != null) { - log.info( - "Dedupe exact-enum: '{}' -> '{}'", - fullEnumName(victimEnum), fullEnumName(match) + log.debug( + "Dedupe exact-enum: {} → {}", + fullEnumName(victimEnum), + fullEnumName(match) ); session.countedMerges.add(IdentityPair.directed(victimEnum, match)); if (!session.dry) { @@ -1298,7 +1313,7 @@ private static void collapseRedundantElementClasses(Model model, Set