Conversation
修复Plain模式下处理oneof字段数量检查的错误信息,并优化失败提示。 同时升级了多个核心依赖库,包括Protobuf、POI、Msgpack、Log4j和JUnit。
There was a problem hiding this comment.
Pull request overview
This PR prepares version 2.23.4 of xresloader with bug fixes related to plain mode field count validation when oneofs are present, improved error messages, and dependency updates.
Changes:
- Fixed field count validation logic for plain mode when oneof fields are present
- Enhanced error messages to include actual data in plain mode failures
- Updated multiple dependencies to newer versions (protobuf, poi, msgpack, junit, gradle shadow plugin)
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/org/xresloader/core/data/dst/DataDstPb.java | Removed duplicate import, modified atLeastFieldSize calculation logic, enhanced error messages with data hints |
| src/org/xresloader/core/data/dst/DataDstJava.java | Modified atLeastFieldSize calculation logic, enhanced error messages with data hints |
| src/org/xresloader/core/data/dst/DataDstImpl.java | Added joinPlainInputHint utility method to format input data for error messages |
| sample/proto_v3/role_cfg.bin | Updated binary test data with new version number |
| sample/proto_v2/role_cfg.bin | Updated binary test data with new version number |
| pom.xml | Bumped version to 2.23.4 and updated dependency versions |
| build.gradle | Bumped version to 2.23.4 and updated dependency versions |
| HISTORY.md | Added changelog entry for version 2.23.4 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "Try to convert %s need at least %d fields, at most %d fields, but provide %d fields.%s > Data: %s", | ||
| field.getTypeDescriptor().getFullName(), atLeastFieldSize, fieldSize, inputs.length, | ||
| ProgramOptions.getEndl()); | ||
| ProgramOptions.getEndl(), ProgramOptions.getEndl(), |
There was a problem hiding this comment.
The format string has only 2 %s placeholders after the numeric placeholders, but 3 string arguments are provided (two calls to ProgramOptions.getEndl() on lines 2916, plus the result of joinPlainInputHint on line 2917). This will cause an IllegalFormatException at runtime.
The correct fix would be to remove one of the ProgramOptions.getEndl() calls, keeping only one between the field count and the data hint, as is done in the similar code in DataDstJava.java at line 1280.
| ProgramOptions.getEndl(), ProgramOptions.getEndl(), | |
| ProgramOptions.getEndl(), |
No description provided.