Add a PriorityQueue type adapter to extras #3183
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 179 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.311
Real PR Conversation Timeline
1 comments
"Review active on #3183"
general
weight: 0.35
wozhenbang2004
Purpose
Add the opt-in
PriorityQueueadapter discussed in #2393.Description
The factory sorts a copy of the queue before serializing it. Both directions delegate to the
List<E>adapter, preserving the declared element type, including wildcard bounds, and registered adapters. The original queue is left intact.This example supports natural-order queues. It rejects custom comparators because they cannot be recovered from the JSON. It is only used when explicitly registered; Gson's default collection handling is unchanged.
Validation:
mvn clean verify javadoc:jar -Dmaven.javadoc.offline=truepasses on JDK 21.0.13.1 (all eight modules). The issue's example produces[1,2,3,4,5,9]with the factory registered, and the queue is unchanged.Javadoc was generated in offline mode; external documentation links were not checked.
Checklist
- [x] Javadoc uses
@since $next-version$- [x] Assertions in unit tests use Truth
- [x] No JUnit 3 features are used
- [x] Bug regression test: not applicable; this adds an opt-in adapter
mvn clean verify javadoc:jar -Dmaven.javadoc.offline=truepasses without errors (external links not checked)