Skip to content

Fix(#4538) Update Dataized for Q/Φ package format migration#4978

Open
AlexNetTie wants to merge 8 commits intoobjectionary:masterfrom
AlexNetTie:fix-4538-f772932
Open

Fix(#4538) Update Dataized for Q/Φ package format migration#4978
AlexNetTie wants to merge 8 commits intoobjectionary:masterfrom
AlexNetTie:fix-4538-f772932

Conversation

@AlexNetTie
Copy link
Copy Markdown
Contributor

@AlexNetTie AlexNetTie commented Apr 6, 2026

Update Dataized to handle new EO package naming format

What does this PR do?

Fixes the logsAllLocationsWithPhSafe and doesNotLogGoToTokenJump tests, which were disabled after migrating EO objects from the org.eolang package to Q. Fixes Dataized methods to work correctly with the new name format.

Related issues:

Fixes https://github.com/objectionary/eo/issues/4538

Changes

Dataized.java

Fixed forma() condition for error messages from %s.string to %s.org.eolang.string
Added enc.forma().endsWith("go.to.token.jump") check to properly handle go.to.token.jump (works with both formats: org.eolang.go.to.token.jump and Φ.go.to.token.jump)
Removed temporary System.out.println statements

DataizedTest.java

Removed @Disabled from logsAllLocationsWithPhSafe test
Removed @Disabled from doesNotLogGoToTokenJump test
Removed @todo lines (38-41)
Removed unused import org.junit.jupiter.api.Disabled

How to test

# Build the project
mvn clean install -DskipTests

# Run fixed tests
mvn -pl eo-runtime test -Dtest=DataizedTest#logsAllLocationsWithPhSafe
mvn -pl eo-runtime test -Dtest=DataizedTest#doesNotLogGoToTokenJump

# Full verification (all tests except problematic ones)
mvn clean install -PskipUTs --errors --batch-mode
mvn clean verify -PskipTests -Pqulice --errors --batch-mode
mvn clean install -Psnippets --errors --batch-mode

Notes

The issue occurred after migrating objects from org.eolang package to Q, which changed the forma() return format
Fixes are backward compatible and work with the old format via endsWith()
All tests pass, qulice shows no errors

Summary by CodeRabbit

  • Bug Fixes

    • Improved runtime error classification by switching to suffix-based detection for certain token and string cases, making error handling more consistent and reliable.
  • Tests

    • Re-enabled two previously disabled unit tests to restore coverage and verify logging and error-handling behavior.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1e660510-607d-4895-891c-2b09511ffd03

📥 Commits

Reviewing files that changed from the base of the PR and between b750e20 and b3760fe.

📒 Files selected for processing (1)
  • eo-runtime/src/main/java/org/eolang/Dataized.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • eo-runtime/src/main/java/org/eolang/Dataized.java

📝 Walkthrough

Walkthrough

Dataized.take() now matches enclosure forms using suffix checks (endsWith) for go.to.token.jump and .string. Two tests in DataizedTest had their @Disabled annotations and related @todo Javadoc entries removed, enabling their execution.

Changes

Cohort / File(s) Summary
Error-handling & enclosure matching
eo-runtime/src/main/java/org/eolang/Dataized.java
Replaced exact equality checks with endsWith checks for "go.to.token.jump" and for global string detection (".string"); preserved existing behavior when .string matches.
Test re-enablement
eo-runtime/src/test/java/org/eolang/DataizedTest.java
Removed @Disabled annotations and related @todo Javadoc entries so logsAllLocationsWithPhSafe() and doesNotLogGoToTokenJump() run.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hop through code with whiskered grace,
Suffixes snug in their new place,
Sleeping tests I wake with a twitch,
Tiny trims, a lighter stitch,
Logs and jumps dance — then I race. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: updating Dataized for Q/Φ package format migration and references the fixed issue (#4538).
Linked Issues check ✅ Passed The PR successfully addresses issue #4538 by updating Dataized to handle the new package naming format with endsWith() checks and re-enabling previously disabled tests.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #4538: updating exception-handling logic for the new package format and re-enabling affected tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

🚀 Performance Analysis

All benchmarks are within the acceptable range. No critical degradation detected (threshold is 100%). Please refer to the detailed report for more information.

Click to see the detailed report
Test Base Score PR Score Change % Change Unit Mode
benchmarks.XmirBench.xmirToEO 243.706 189.812 -53.895 -22.11% ms/op Average Time

✅ Performance gain: benchmarks.XmirBench.xmirToEO is faster by 53.895 ms/op (22.11%)

Comment thread eo-runtime/src/main/java/org/eolang/Dataized.java Outdated
@AlexNetTie AlexNetTie changed the title Fix 4538 f772932 Fix(#4538) Update Dataized for Q/Φ package format migration Apr 7, 2026
throw new EOerror.ExError(enc);
}
if (String.format("%s.string", PhPackage.GLOBAL).equals(enc.forma())) {
if (enc.forma().endsWith(".string")) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexNetTie it's a hack and does not solve the real problem with incorrect forma of the object
@yegor256 FYI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxonfjvipon, Thank you, I will continue to correct it.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants