← Back to Pull requests

Fix launch library deduplication for variants and renamed modules #7363

Merged
Glavo merged 3 files (177 lines) on Nov 25, 2026 15:00 UTC
View on GitHub
Glavo Glavo commented on Nov 25, 2026 13:47 UTC
Author

Fix #7353

Diff: 177 lines (+161 / -16) across 3 files Reviewer: github-actions[bot] Review duration: 73m
All Vouch review confidence checks passed
Residual risk 0.08 = Change Risk (0.37) × (1 − Review Confidence (0.79)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 177 lines diff across 3 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.63 · 1 substantive comment(s)
0.63
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
78%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.310
Empty Description empty_description
0.060
Real PR Conversation Timeline
3 items
github-actions[bot] github-actions[bot] commented on code on Nov 25, 2026 13:49 UTC
Code Review
HMCLCore/src/main/java/org/jackhuang/hmcl/game/LaunchManifestNormalizer.java:1
@@ -335,9 +333,46 @@ private static GameInstanceManifest uniqueLibraries(GameInstanceManifest manifes
             }
         }
 
+        Map<String, VersionNumber> successorVersions = new HashMap<>();
+        for (Library library : libraries) {
+            @Nullable String formerId = formerModuleId(moduleId(library), library.version());
+            if (formerId != null && indexes.containsKey(formerId) && isPlainClasspathJar(library)) {
+                successorVersions.merge(formerId, VersionNumber.asVersion(library.version()),
+                        BinaryOperator.maxBy(Comparator.naturalOrder()));
+            }
+        }
+        if (!successorVersions.isEmpty()) {
+            libraries.removeIf(library -> {
+                @Nullable VersionNumber successor = successorVersions.get(moduleId(library));
+                return successor != null && isPlainClasspathJar(library)
+                        && successor.compareTo(VersionNumber.asVersion(library.version())) >= 0;
+            });
+        }
         return libraries.size() == manifest.getLibraries().size()
                 ? manifest
                 : manifest.withLibraries(libraries);
     }
 
+    /// Returns the group and artifact name used to identify a module across versions.
+    private static String moduleId(Library library) {
+        return library.groupId() + ":" + library.artifactId();
+    }
+
+    /// Returns whether this declaration selects an unclassified JAR for the current platform's classpath.
+    private static boolean isPlainClasspathJar(Library library) {
+        return library.appliesToCurrentEnvironment() && !library.isNative()
+                && library.classifier() == null && "jar".equals(library.artifact().getExtension());
+    }
+
+    /// Returns the former module ID superseded by this JAR, or `null` if no mapping is known.
+    private static @Nullable String formerModuleId(String id, String version) {
+        return switch (id) {
+            case "net.java.dev.jna:jna-platform" -> "net.java.dev.jna:platform";
+            case "com.github.oshi:oshi-common" -> "oshi-project:oshi-core";
+            // From 6.12.0 onward, the shared hardware interfaces reside in oshi-common.
+            case "com.github.oshi:oshi-core", "com.github.oshi:oshi-core-java11", "com.github.oshi:oshi-core-java25" ->
+                    VersionNumber.compare(version, "6.12.0") < 0 ? "oshi-project:oshi-core" : null;

[ERROR] [com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck]

'lambda' child has incorrect indentation level 20, expected level should be 16.

github-actions[bot] github-actions[bot] commented on Nov 25, 2026 13:49 UTC
Reviewer

🤖 Static analysis found the following issues (max count 10):

Assignees
Glavo Glavo
Labels
risk: low confidence: 78.6% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.9% (MEDIUM) · Higher = larger blast radius
36.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 78.6% · Lower = rushed or shallow review
78.6%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 7.9% · Safe to merge
7.9%
Repository