← Back to Pull requests

Add Java reflection bindings to the distribution #7851

Merged
chuckatkins merged 13 files (1225 lines) on Mar 03, 2023 19:14 UTC
View on GitHub
chuckatkins chuckatkins commented on Mar 03, 2023 16:37 UTC
Author

The distributions for C++ and Python include the generated reflection bindings but are currently missing from the other language packages. This will bring the Java package generated for releases closer to feature parity with the C++ and Python release artifacts.

Diff: 1225 lines (+1225 / -0) across 13 files Reviewer: dbaileychess Review duration: 156m
All Vouch review confidence checks passed
Residual risk 0.08 = Change Risk (0.61) × (1 − Review Confidence (0.87)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.61 · 1225 lines diff across 13 files
0.61
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.82 · 3 substantive comment(s)
0.82
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
86%
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.400
Real PR Conversation Timeline
5 items
dbaileychess dbaileychess commented on code on Mar 03, 2023 17:27 UTC
Code Review
scripts/generate_code.py:1
@@ -507,6 +507,12 @@ def glob(path, pattern):
 # Python Reflection
 flatc_reflection(["-p"], "python/flatbuffers", "reflection")
 
+# Java Reflection
+flatc_reflection(
+    ["-j", "--java-package-prefix", "com.google.flatbuffers"],
+    "java/src/main/java", "com/google/flatbuffers/reflection"

is there a reason it stored in such a deeply nested com/google/flatbuffers/reflection directory?

chuckatkins chuckatkins commented on code on Mar 03, 2023 18:37 UTC
Code Review
scripts/generate_code.py:1
@@ -507,6 +507,12 @@ def glob(path, pattern):
 # Python Reflection
 flatc_reflection(["-p"], "python/flatbuffers", "reflection")
 
+# Java Reflection
+flatc_reflection(
+    ["-j", "--java-package-prefix", "com.google.flatbuffers"],
+    "java/src/main/java", "com/google/flatbuffers/reflection"

My intent is to align with the package name of com.google.flatbuffers.reflection the same way the core api is in the package com.google.flatbuffers and the associated *.java files are in java/src/main/java/com/google/flatbuffers. This is also consistent with the Python API where the generated reflection module, flatbuffers.reflection, is nested under the top level flatbuffers module.

chuckatkins chuckatkins commented on code on Mar 03, 2023 18:40 UTC
Code Review
scripts/generate_code.py:1
@@ -507,6 +507,12 @@ def glob(path, pattern):
 # Python Reflection
 flatc_reflection(["-p"], "python/flatbuffers", "reflection")
 
+# Java Reflection
+flatc_reflection(
+    ["-j", "--java-package-prefix", "com.google.flatbuffers"],
+    "java/src/main/java", "com/google/flatbuffers/reflection"

This also models the directory structure of the compiled class files when building flatbuffers-XX.YY.XX.jar with maven via mvn package in the top level java/ directory.

dbaileychess dbaileychess approved these changes on Mar 03, 2023 19:14 UTC
Approved Reviewer

Approved these changes.

Reviewers
Assignees
chuckatkins chuckatkins
Labels
risk: low confidence: 86.7% 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: 60.6% (MEDIUM) · Higher = larger blast radius
60.6%
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: 86.7% · Lower = rushed or shallow review
86.7%
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: 8.1% · Safe to merge
8.1%