fix: filter columns by java field name for camel case field names #1130
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.52) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 427 lines diff across 5 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
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1130"
general
weight: 0.35
BigDataDZ
The column filter compared the name kept by the cglib bean map of a field with the field names configured through includeColumnFieldNames/excludeColumnFieldNames. For a field whose name starts with a lower case letter followed by an upper case letter, for example xRealIp or pName, the two names differ, so includeColumnFieldNames dropped the column and excludeColumnFieldNames kept it. The reorder by include list also assigned a position to an unknown column name, which shifted the following columns.
<!--
Thanks very much for contributing to Apache Fesod (Incubating)! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.## Purpose of the pull request
Closed: #1129
What's changed?
includeColumnFieldNamesandexcludeColumnFieldNamescompare the configured names withFieldWrapper#getFieldName, which is the name kept by the cglib bean map of a field (FieldUtils#resolveCglibFieldName). For a field name that starts with a lower case letter followed by an upper case letter, for examplexRealIporpName, that name isXRealIpandPName, so the comparison never matches the Java field name the user configures:includeColumnFieldNames(Arrays.asList("name", "xRealIp", "pName"))writes only thenamecolumn, the other two are dropped from the file, without any error.excludeColumnFieldNames(Arrays.asList("xRealIp"))does not exclude the column.The same name is used in
ClassUtils#resortField, where every configured name took a position, so an unknown name left a hole and shifted the following columns whenorderByIncludeColumn(true)is used.The change uses the Java field name (
field.getField().getName()) for the include/exclude check, and rebuilds the order from the include list by looking the field up by Java field name, skipping an unknown name so that it does not hold a column position. The cglib name is still used everywhere it is required, for example to read the value out of the bean map.New unit tests cover field names of this shape for writing all columns, including a subset, excluding, an unknown name in the include list, and the same with
orderByIncludeColumn(true). The test class fails on the current main branch (15 of 21 cases) and passes with the change.Local verification with Temurin 1.8.0_472:
./mvnw clean package -B -Dmaven.test.skip=false -pl fesod-common,fesod-shaded,fesod-sheet-> 937 tests, 0 failures./mvnw spotless:check-> Build successChecklist
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
Closed: #ISSUE
Related: #ISSUE
-->
Purpose of the pull request
<!-- Describe the purpose of this pull request. For example: Closed: #ISSUE-->
What's changed?
<!--- Describe the change below, including rationale and design decisions -->
Checklist