Repository navigation
Conversation
Fixes ArcadeData#10756 Signed-off-by: 7487 <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Shared number conversion engine/src/main/java/com/arcadedb/serializer/json/JSONObject.java |
elementToObject delegates numeric conversion to the new public parseNumber(String) method, which retains the existing conversion rules. |
Importer parsing and validation integration/src/main/java/com/arcadedb/integration/importer/format/JSONImporterFormat.java, integration/src/test/java/com/arcadedb/integration/importer/JSONImporterIT.java |
The importer uses JSONObject.parseNumber for numeric properties and array entries. The integration test checks imported numeric values and Java types. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: High
Possibly related PRs
- ArcadeData/arcadedb#9131: It changes
JSONObjectnumber decoding, whose conversion rules this PR exposes and reuses in the JSON importer.
Suggested labels: bug, engine
Suggested reviewers: lvca, robfrank
Merge Risk: 
Minimal · up to 7c3c7
-
No actionable issue is established; the change is ready to merge after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description clearly explains the issue, implementation, scope, testing, and verification. It does not use the exact template headings and omits the checklist, but it provides the required information in equivalent sections.
Full details: Linked Issues check
-
Explanation
Issue [
#10756] requires JSON importer numbers to preserve the existingJSONObjectnumber-decoding behavior in object and array positions.JSONImporterFormatnow callsJSONObject.parseNumber(reader.nextString())in bothNUMBERpaths.JSONObject.elementToObjectalso uses this extracted decoder, including Integer, Long, Double, BigDecimal, and oversized-number validation branches.JSONImporterITverifies exact values and types for object properties and array entries, including an integer above 2^53 and a value beyondlong.
Full details: Out of Scope Changes check
-
Explanation
The changes are limited to the requested shared number decoder, its two importer call sites, and importer regression coverage for issue [
#10756]. The test and refactoring directly support the issue. No unrelated format, schema, dependency, configuration, or record-rewrite changes appear in the reviewed diff.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
This pull request is closed, so it cannot be queued. Reopen it to get the box back. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 449 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
@claude review |
|
Claude finished @robfrank's task in 21s —— View job Review of PR #10774 (preserve JSON number types in importer)Verdict: looks good, no blocking issues.
What I checked
Minor, non-blocking notes
No security or performance concerns. |
|
Triage: The change is small and does what it says. It also follows the project's principle of reusing existing components.
Minor, non-blocking notes:
|
|
Automated review: not finished, will retry no test in scope could run in the sandbox. Nothing was found against the PR; the next review run tries again. Why: Automation limit: the review could not finish on its own; nothing was found against the PR. Next step: Nothing; the next review run tries again.
Improvements
|
|
Automated review: changes needed fix incomplete: The PR changes com.arcadedb.serializer.json.JSONObject, which is referenced by far more than 100 test classes across modules, so the scope is too wide for automated review. I did not run any tests. The Bash and Grep tools here would not let me count the references, so this is an inference, not a cou. The contributor has findings to address. Why: The PR needs changes: the GitHub triage or the tests found problems the automated fixer could not resolve. Next step: Read the latest classify-pr triage comment on this PR and address its findings.
|
|
Thank you @7487 for tracking this down and for the clear regression test. Main fixed #10756 independently in #10904 ( Once this branch is merged with main, its only remaining change is the
So I'm closing this as superseded by #10904. The earlier |
Summary
Fixes #10756.
The JSON importer read every numeric token with
JsonReader.nextDouble(). As a result, integers were stored asDoublevalues and integers above 2^53 could be silently rounded.This change reuses
JSONObject's existing numeric token decoder in both importer number paths, so imported values retain the sameInteger,Long,Double, orBigDecimalrepresentation as the project's JSON reader.Changes
JSONObjectnumber-token decision intoJSONObject.parseNumber(String).JSONImporterFormat.No dependency, schema, configuration, or unrelated behavior change is included. Existing records are not rewritten.
Verification
expected: 42/actual: 42.0before the fix.JSONImporterITplusIssue9004JsonNumbersBeyondLongAndDoubleTest, 20 tests passed.uvx pre-commit run --from-ref origin/main --to-ref HEADpassed all applicable hooks.git diff origin/main...HEAD --checkpassed.The local network transparently resolves reserved negative-test hostnames. DNS-negative modules were therefore run with
-Djdk.net.hosts.file=/etc/hosts; dependency-resolving modules were run without that option. One unrelated HA timing assertion was reproduced on the untouched base and then passed as part of the complete HA class and the final 3,249-test HA run.Visual verification
Not applicable. This change has no UI surface.
Summary by CodeRabbit