Skip to content

bug(#3480): Attr replacement with Phi#4223

Merged
yegor256 merged 21 commits into
objectionary:masterfrom
h1alexbel:3480-pha
Jun 5, 2025
Merged

bug(#3480): Attr replacement with Phi#4223
yegor256 merged 21 commits into
objectionary:masterfrom
h1alexbel:3480-pha

Conversation

@h1alexbel

@h1alexbel h1alexbel commented May 30, 2025

Copy link
Copy Markdown
Member

In this PR I've removed redundant org.eolang.Attr interface in lieu of org.eolang.Phi. Left several puzzles.

see #3480
History:

Summary by CodeRabbit

  • New Features

    • Introduced new classes for attribute handling and caching, providing improved lazy evaluation, immutability enforcement, and thread safety.
    • Added new constants and methods to the core object interface for enhanced and consistent attribute management.
  • Refactor

    • Replaced legacy attribute classes and interfaces with updated counterparts across the codebase.
    • Updated internal logic and templates to use new attribute handling mechanisms, improving consistency and maintainability.
  • Bug Fixes

    • Enhanced error handling and immutability enforcement for attribute operations.
  • Tests

    • Updated all test cases to use new attribute classes and constants, ensuring compatibility and reliability.
  • Chores

    • Disabled select integration tests pending dependency updates.
    • Removed obsolete attribute-related classes and interfaces to streamline the codebase.

@github-actions

github-actions Bot commented May 30, 2025

Copy link
Copy Markdown
Contributor

🚀 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 139.319 145.022 5.703 4.09% ms/op Average Time
benchmarks.XmirBench.xmirToPhi 141.155 139.633 -1.522 -1.08% ms/op Average Time
benchmarks.XmirBench.xmirToSaltyPhi 151.864 168.109 16.245 10.70% ms/op Average Time

⚠️ Performance loss: benchmarks.XmirBench.xmirToEO is slower by 5.703 ms/op (4.09%)
✅ Performance gain: benchmarks.XmirBench.xmirToPhi is faster by 1.522 ms/op (1.08%)
⚠️ Performance loss: benchmarks.XmirBench.xmirToSaltyPhi is slower by 16.245 ms/op (10.70%)

@h1alexbel

Copy link
Copy Markdown
Member Author

@maxonfjvipon please check

@h1alexbel

Copy link
Copy Markdown
Member Author

@maxonfjvipon reminder

Comment thread eo-runtime/src/main/java/org/eolang/PhRho.java Outdated
Comment thread eo-runtime/src/main/java/org/eolang/PhComposite.java
Comment thread eo-runtime/src/main/java/org/eolang/PhComposite.java
Comment thread eo-runtime/src/main/java/org/eolang/PhaLogged.java Outdated
Comment thread eo-runtime/src/main/java/org/eolang/PhaOnce.java Outdated
@coderabbitai

coderabbitai Bot commented Jun 2, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This change eliminates the legacy Attr attribute interface and its implementations, replacing them with the Phi interface and new classes such as PhVoid, PhComposite, PhCached, PhRho, and PhWithRho. All runtime and test code is updated to use these new abstractions. Related test classes and XSL templates are also revised to reflect these changes, and integration tests are temporarily disabled.

Changes

File(s) / Group Change Summary
eo-runtime/src/main/java/org/eolang/Attr.java, AtComposite.java, AtEnvelope.java, AtLogged.java, AtOnce.java, AtRho.java, AtWithRho.java Deleted the Attr interface and all its implementations: AtComposite, AtEnvelope, AtLogged, AtOnce, AtRho, AtWithRho.
eo-runtime/src/main/java/org/eolang/PhVoid.java Added new class PhVoid implementing Phi, replacing AtVoid. It supports single assignment and throws on reset; updated method signatures and behavior for the new interface.
eo-runtime/src/main/java/org/eolang/PhComposite.java Added new class PhComposite (implements Phi) for lazy, context-dependent attribute evaluation, replacing AtComposite.
eo-runtime/src/main/java/org/eolang/PhCached.java Added new class PhCached (implements Phi) for caching attribute values, replacing AtOnce.
eo-runtime/src/main/java/org/eolang/PhRho.java Added new class PhRho (implements Phi) for the special \rho attribute, replacing AtRho.
eo-runtime/src/main/java/org/eolang/PhWithRho.java Added new class PhWithRho (implements Phi) for wrapping attributes and setting rho, replacing AtWithRho.
eo-runtime/src/main/java/org/eolang/PhDefault.java Refactored to use Phi-based attribute map and methods, replacing Attr types and logic. Added copy(Phi self) method.
eo-runtime/src/main/java/org/eolang/PhPackage.java, PhLogged.java, PhOnce.java, PhSafe.java Updated to use Phi.RHO instead of Attr.RHO; added/updated copy(Phi self) methods.
eo-runtime/src/main/java/org/eolang/Phi.java Extended interface: added LAMBDA, PHI, RHO constants, and new copy(Phi self) method.
eo-runtime/src/main/java/org/eolang/PhEnvelope.java Added new abstract class PhEnvelope (implements Phi) for delegation, replacing AtEnvelope.
eo-runtime/src/test/java/org/eolang/PhSimple.java Renamed from AtSimple, now extends PhEnvelope and uses PhComposite.
eo-runtime/src/main/java/EOorg/EOeolang/*, EOerror.java, ... Replaced all usage of AtVoid, AtComposite, AtOnce, Attr, etc. with PhVoid, PhComposite, PhCached, Phi, etc.; updated attribute access and initialization logic accordingly.
eo-runtime/src/main/java/org/eolang/Data.java Added copy(Phi self) override in Data.ToPhi.
eo-runtime/src/main/java/org/eolang/PhLogged.java, PhOnce.java, PhSafe.java Added copy(Phi self) override.
eo-runtime/src/test/java/org/eolang/PhCompositeTest.java Renamed from AtCompositeTest, updated for PhComposite.
eo-runtime/src/test/java/org/eolang/PhMethodTest.java, PhLoggedTest.java, PhPackageTest.java, PhWithTest.java, PhCopyTest.java, PhDefaultTest.java, PhSimple.java, PhTryTest.java, PhNumberTest.java, PhWithTest.java, PhEnvelope.java, PhTest.java, ... Updated all test classes to use new Ph* classes and constants (Phi.RHO, etc.), replacing legacy At*/Attr references.
eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl Updated XSL templates to generate PhVoid, PhCached, PhComposite, etc. instead of legacy attribute wrappers.
eo-integration-tests/src/test/java/integration/ReadmeSnippetsIT.java, SnippetIT.java Disabled integration tests due to dependency on old plugin version and added @todo for re-enabling after upgrade.

Sequence Diagram(s)

sequenceDiagram
    participant EO_Object as EO Object (extends PhDefault)
    participant Attribute as PhVoid/PhComposite/PhCached/PhRho
    participant Client as Client Code

    Client->>EO_Object: new EO_Object()
    EO_Object->>Attribute: add("attr", new PhVoid("attr"))
    Client->>EO_Object: take("attr")
    EO_Object->>Attribute: take("attr")
    Attribute-->>Client: returns value or throws if unset
Loading

Suggested reviewers

  • maxonfjvipon
  • yegor256

Poem

In the meadow where attributes grew old,
The rabbits hopped and refactored, bold.
Out with Attr, in with Phi,
Now attributes are hopping free!
PhVoid and friends, with caching delight,
Make EO code run just right—
Hippity-hop, the future is bright! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29c880a and 7d327eb.

📒 Files selected for processing (1)
  • eo-runtime/src/main/java/org/eolang/PhVoid.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • eo-runtime/src/main/java/org/eolang/PhVoid.java
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: snippets
  • GitHub Check: benchmark
  • GitHub Check: ebnf
  • GitHub Check: integration
  • GitHub Check: qulice
  • GitHub Check: mvn (windows-2022, 23)
  • GitHub Check: mvn (ubuntu-24.04, 23)
  • GitHub Check: mvn (ubuntu-24.04, 11)
  • GitHub Check: ort
  • GitHub Check: mvn (macos-15, 23)
  • GitHub Check: trufflehog
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 16

🔭 Outside diff range comments (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)

84-95: ⚠️ Potential issue

Same race condition in positional put method.

This method has the identical TOCTOU race condition as the named put method.

Apply the same fix using compareAndSet:

-    public void put(final int pos, final Phi phi) {
-        if (this.object.get() == null) {
-            this.object.set(phi);
-        } else {
-            throw new ExReadOnly(
-                String.format(
-                    "This void attribute \"%s\" is already set, can't reset",
-                    this.name
-                )
-            );
-        }
-    }
+    public void put(final int pos, final Phi phi) {
+        if (!this.object.compareAndSet(null, phi)) {
+            throw new ExReadOnly(
+                String.format(
+                    "This void attribute \"%s\" is already set, can't reset",
+                    this.name
+                )
+            );
+        }
+    }
♻️ Duplicate comments (4)
eo-runtime/src/main/java/org/eolang/PhaLogged.java (1)

16-16: Consider merging with PhLogged class.

This appears to be similar functionality to PhLogged. Consider if these classes can be consolidated to avoid duplication.

eo-runtime/src/main/java/org/eolang/PhComposite.java (3)

44-46: Verified: Consistent implementation aligns with past review discussion.

Both take(int pos) and take(String name) return this.expr.apply(this.argument), which is consistent with the previous discussion where it was clarified that the result of the expression needs to be taken out, not its nested object.

Also applies to: 59-61


44-46: Implementation appears correct based on maintainer feedback.

The take(int pos) method returns the result of the expression directly. Based on past review comments, this design was intentionally chosen to return the evaluated expression result rather than taking a nested object from it.


59-61: Implementation appears correct based on maintainer feedback.

Similar to take(int pos), this method returns the expression result directly, which aligns with the maintainer's explanation that "we need the result of expr to be taken out, not its nested object."

🧹 Nitpick comments (8)
eo-integration-tests/src/test/java/integration/ReadmeSnippetsIT.java (1)

23-34: Appropriate temporary measure for plugin compatibility.

Disabling this test class is the correct approach while the eo-maven-plugin is updated to version 0.56.3 to support the new Phi interface. This prevents CI failures due to the removed org.eolang.Attr class.

Consider adding a TODO comment or tracking issue to ensure these tests are re-enabled once the plugin is updated.

eo-runtime/src/test/java/org/eolang/PhCompositeTest.java (1)

14-29: LGTM: Class rename and TODO comment noted.

The class renaming from AtCompositeTest to PhCompositeTest is correct. The TODO comment at line 24-26 indicates awareness of technical debt regarding the TO_ADD_MESSAGE field usage across multiple test files.

eo-runtime/src/test/java/org/eolang/PhMethodTest.java (2)

21-24: Prefer assertNotSame (or Hamcrest’s not(sameInstance())) for identity checks

The intent here is to confirm that two invocations of num.take("plus") yield different objects (identity inequality), not merely objects that are not equal via equals().

Using Matchers.not(Matchers.equalTo(...)) will also pass when the two instances are identical but their equals() implementation returns false. A safer expectation is to assert they are not the same instance.

-Matchers.not(Matchers.equalTo(num.take("plus")))
+Matchers.not(Matchers.sameInstance(num.take("plus")))

(or use assertNotSame from JUnit).
This keeps the test aligned with the semantic goal.


100-113: Race-condition possibility on count in concurrent tests

count is incremented from a lambda executed inside PhComposite. If the test suite is ever executed in parallel (JUnit 5 allows this), multiple threads could call new Dataized(phi).take() simultaneously, leading to a data race on count.

Consider either:

  1. Marking count as AtomicInteger, or
  2. Restricting access through synchronization.

This is not an immediate bug for the current single-threaded test, but hardening the test class will avoid flaky behaviour under parallel execution settings.

eo-runtime/src/main/java/org/eolang/PhWithRho.java (1)

100-106: Package-private origin() tight-couples callers to implementation

origin() is exposed solely for PhDefault.put(int, Phi) and comes with a TODO. Keeping it encourages down-casting ((PhWithRho)) and violates encapsulation.

Consider:

  1. Moving origin() to a dedicated interface used by PhDefault, or
  2. Replacing the cast with a polymorphic query (isVoid()?) on Phi.

Tidying this up will make it easier to drop the PMD suppression and improves maintainability.

eo-runtime/src/main/java/org/eolang/PhDefault.java (3)

123-134: Unsafe cast to PhWithRho may break when foreign Phi is injected

put(int, Phi) assumes every stored attribute is a PhWithRho, but defaults() inserts a plain PhRho and external code could mutate attrs (reflection, tests).

if (!(((PhWithRho) this.attrs.get(name)).origin() instanceof PhVoid)) {

Consider replacing the cast with a safe check:

final Phi stored = this.attrs.get(name);
if (!(stored instanceof PhWithRho w && w.origin() instanceof PhVoid)) {
    ...
}

This avoids ClassCastException and clarifies intent.


251-256: add() bypasses null-checks; defensive copy recommended

add(String, Phi) inserts the passed attr directly. Passing null silently causes NPEs later.
Add a precondition:

Objects.requireNonNull(attr, "Attribute must not be null");

to fail fast and aid debugging.


313-317: defaults() returns mutable map exposed to instance state

Although a new HashMap is created per object, returning a concrete mutable implementation invites accidental sharing if reused elsewhere.
Return Collections.unmodifiableMap(...) or wrap the entry on insertion to avoid external mutation.

private static Map<String, Phi> defaults() {
    return Map.of(Phi.RHO, new PhRho());
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9ebd50 and 1d01f49.

📒 Files selected for processing (101)
  • eo-integration-tests/src/test/java/integration/ReadmeSnippetsIT.java (2 hunks)
  • eo-integration-tests/src/test/java/integration/SnippetIT.java (1 hunks)
  • eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl (4 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOand.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOconcat.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOeq.java (3 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOnot.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOor.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOright.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOsize.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOslice.java (3 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOxor.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOdir$EOmade$EOmkdir.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOdir$EOtmpfile$EOtouch.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOdir$EOwalk.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOdeleted$EOdelete.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOexists.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOis_directory.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOmoved$EOmove.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOopen$EOfile_stream$EOread$EOread_bytes.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOopen$EOfile_stream$EOwrite$EOwritten_bytes.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOopen$EOprocess_file.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOsize.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOtouched$EOtouch.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi16$EOas_i32.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi32$EOas_i64.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOas_number.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOdiv.java (3 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOgt.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOplus.java (3 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOtimes.java (3 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOread.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOresized.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOsize.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOwrite.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOφ.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOangle$EOcos.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOangle$EOsin.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOacos.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOasin.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOln.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOpow.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOsqrt.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOas_i64.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOdiv.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOfloor.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOgt.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOplus.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOtimes.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOsys/EOposix$EOφ.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOsys/EOwin32$EOφ.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOtry.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOregex$EOpattern$EOmatch$EOmatched_from_index.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOregex$EOφ.java (1 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOsprintf.java (2 hunks)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOsscanf.java (2 hunks)
  • eo-runtime/src/main/java/org/eolang/AtComposite.java (0 hunks)
  • eo-runtime/src/main/java/org/eolang/AtLogged.java (0 hunks)
  • eo-runtime/src/main/java/org/eolang/AtOnce.java (0 hunks)
  • eo-runtime/src/main/java/org/eolang/AtRho.java (0 hunks)
  • eo-runtime/src/main/java/org/eolang/AtWithRho.java (0 hunks)
  • eo-runtime/src/main/java/org/eolang/Attr.java (0 hunks)
  • eo-runtime/src/main/java/org/eolang/Data.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhCached.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhComposite.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhDefault.java (11 hunks)
  • eo-runtime/src/main/java/org/eolang/PhLogged.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhOnce.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhPackage.java (3 hunks)
  • eo-runtime/src/main/java/org/eolang/PhRho.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhSafe.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhVoid.java (4 hunks)
  • eo-runtime/src/main/java/org/eolang/PhWithRho.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhaLogged.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/Phi.java (2 hunks)
  • eo-runtime/src/test/java/EOorg/EOeolang/EObytesEOconcatTest.java (2 hunks)
  • eo-runtime/src/test/java/EOorg/EOeolang/EOerrorTest.java (3 hunks)
  • eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java (5 hunks)
  • eo-runtime/src/test/java/EOorg/EOeolang/EOnet/EOsocketTest.java (5 hunks)
  • eo-runtime/src/test/java/EOorg/EOeolang/EOnumberTest.java (6 hunks)
  • eo-runtime/src/test/java/EOorg/EOeolang/EOtryTest.java (7 hunks)
  • eo-runtime/src/test/java/EOorg/EOeolang/HeapsTest.java (15 hunks)
  • eo-runtime/src/test/java/org/eolang/AtEnvelope.java (0 hunks)
  • eo-runtime/src/test/java/org/eolang/BytesOfTest.java (12 hunks)
  • eo-runtime/src/test/java/org/eolang/DataTest.java (2 hunks)
  • eo-runtime/src/test/java/org/eolang/ExInterruptedTest.java (1 hunks)
  • eo-runtime/src/test/java/org/eolang/ExpectTest.java (6 hunks)
  • eo-runtime/src/test/java/org/eolang/JavaPathTest.java (1 hunks)
  • eo-runtime/src/test/java/org/eolang/MainTest.java (3 hunks)
  • eo-runtime/src/test/java/org/eolang/PhCompositeTest.java (3 hunks)
  • eo-runtime/src/test/java/org/eolang/PhCopyTest.java (2 hunks)
  • eo-runtime/src/test/java/org/eolang/PhDefaultTest.java (31 hunks)
  • eo-runtime/src/test/java/org/eolang/PhLoggedTest.java (4 hunks)
  • eo-runtime/src/test/java/org/eolang/PhMethodTest.java (7 hunks)
  • eo-runtime/src/test/java/org/eolang/PhPackageTest.java (7 hunks)
  • eo-runtime/src/test/java/org/eolang/PhWithTest.java (6 hunks)
  • eo-runtime/src/test/java/org/eolang/PhaEnvelope.java (1 hunks)
  • eo-runtime/src/test/java/org/eolang/PhaLoggedTest.java (3 hunks)
  • eo-runtime/src/test/java/org/eolang/PhaSimple.java (1 hunks)
  • eo-runtime/src/test/java/org/eolang/PhiTest.java (5 hunks)
💤 Files with no reviewable changes (7)
  • eo-runtime/src/test/java/org/eolang/AtEnvelope.java
  • eo-runtime/src/main/java/org/eolang/AtWithRho.java
  • eo-runtime/src/main/java/org/eolang/AtRho.java
  • eo-runtime/src/main/java/org/eolang/Attr.java
  • eo-runtime/src/main/java/org/eolang/AtLogged.java
  • eo-runtime/src/main/java/org/eolang/AtComposite.java
  • eo-runtime/src/main/java/org/eolang/AtOnce.java
🧰 Additional context used
🧬 Code Graph Analysis (30)
eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOpow.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOtry.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-integration-tests/src/test/java/integration/ReadmeSnippetsIT.java (1)
eo-integration-tests/src/test/java/integration/SnippetIT.java (1)
  • Disabled (37-97)
eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOsprintf.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOsscanf.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOtimes.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOplus.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOregex$EOpattern$EOmatch$EOmatched_from_index.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOeq.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOslice.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/test/java/EOorg/EOeolang/EOnet/EOsocketTest.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOwrite.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-integration-tests/src/test/java/integration/SnippetIT.java (1)
eo-integration-tests/src/test/java/integration/ReadmeSnippetsIT.java (1)
  • Disabled (34-98)
eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOopen$EOfile_stream$EOread$EOread_bytes.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOxor.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOdiv.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOtimes.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOopen$EOfile_stream$EOwrite$EOwritten_bytes.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOright.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOdiv.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOgt.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOread.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOresized.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOor.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/test/java/EOorg/EOeolang/EOtryTest.java (2)
eo-runtime/src/main/java/org/eolang/PhComposite.java (1)
  • PhComposite (17-91)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOplus.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOconcat.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOdir$EOwalk.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOgt.java (1)
eo-runtime/src/main/java/org/eolang/PhVoid.java (1)
  • PhVoid (18-137)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: ebnf
  • GitHub Check: integration
  • GitHub Check: mvn (windows-2022, 23)
  • GitHub Check: mvn (ubuntu-24.04, 11)
  • GitHub Check: mvn (ubuntu-24.04, 23)
🔇 Additional comments (182)
eo-runtime/src/test/java/org/eolang/JavaPathTest.java (1)

30-30: Update test to use PhComposite constant
Changed the assertion from AtCompositeTest.TO_ADD_MESSAGE to PhCompositeTest.TO_ADD_MESSAGE, reflecting the interface consolidation and class renaming.

eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOregex$EOφ.java (1)

35-35: Switch attribute access to Phi.RHO
Replaced this.take(Attr.RHO) with this.take(Phi.RHO) to align with the removal of the Attr interface and use the unified Phi constants.

eo-runtime/src/main/java/EOorg/EOeolang/EOsys/EOwin32$EOφ.java (1)

74-74: Use Phi.RHO instead of Attr.RHO
Updated the lambda() method to call this.take(Phi.RHO), consistent with the new Phi-based attribute model.

eo-runtime/src/main/java/EOorg/EOeolang/EOsys/EOposix$EOφ.java (1)

72-72: Adopt Phi.RHO for attribute retrieval
Switched from this.take(Attr.RHO) to this.take(Phi.RHO) in lambda(), completing the migration to the Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOφ.java (1)

29-29: Replace Attr.RHO with Phi.RHO
Adjusted the lambda() implementation to use this.take(Phi.RHO) in place of the deprecated Attr.RHO.

eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java (2)

20-20: Import PhVoid in place of legacy AtVoid.

The new import aligns with the migration from the old Attr/AtVoid API to the Phi/PhVoid model.


43-43: Use PhVoid for the "message" attribute.

Replacing the old AtVoid with PhVoid ensures the EOerror object initializes its "message" field via the new Phi-based void attribute.

eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOas_number.java (1)

30-30: Switch to Phi.RHO instead of deprecated Attr.RHO.

This update correctly references the new attribute constant on the Phi interface for rho.

eo-runtime/src/main/java/EOorg/EOeolang/EOtry.java (2)

16-16: Add import for PhVoid.

Ensures the new void attribute class is available for initializing "main", "catch", and "finally".


33-35: Initialize "main", "catch", and "finally" with PhVoid.

Replacing AtVoid usage with PhVoid is consistent with the refactored Phi-based attribute model.

eo-runtime/src/main/java/EOorg/EOeolang/EOi32$EOas_i64.java (1)

36-36: Update attribute access to use Phi.RHO.

This replaces the old Attr.RHO constant with the new Phi.RHO constant, aligning with the broader refactoring.

eo-runtime/src/test/java/EOorg/EOeolang/EObytesEOconcatTest.java (2)

14-14: Replace import of AtCompositeTest with PhCompositeTest.

Tests should reference the new PhCompositeTest class following the migration of composite attribute implementations.


32-32: Use PhCompositeTest.TO_ADD_MESSAGE instead of AtCompositeTest.TO_ADD_MESSAGE.

Aligns the test’s failure message constant with the updated PhCompositeTest.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOexists.java (2)

36-36: LGTM! Consistent refactoring change.

The update from Attr.RHO to Phi.RHO is correct and aligns with the PR objective to replace the Attr interface with Phi. The functionality remains unchanged.


36-36: LGTM! Clean refactoring from Attr to Phi interface.

The constant replacement from Attr.RHO to Phi.RHO is correct and consistent with the broader refactoring effort to migrate from the Attr interface to the Phi interface.

eo-runtime/src/test/java/org/eolang/PhCopyTest.java (2)

21-21: LGTM! Necessary test constant update.

The change from AtCompositeTest.TO_ADD_MESSAGE to PhCompositeTest.TO_ADD_MESSAGE is correct and necessary as part of the refactoring from At* to Ph* classes.


33-33: LGTM! Consistent with the test message update.

Same appropriate change as line 21, updating the test message constant reference to the new PhCompositeTest class.

eo-runtime/src/main/java/org/eolang/PhLogged.java (1)

87-90: LGTM! Proper interface method implementation.

The new copy(Phi self) method correctly implements the new Phi interface requirement by delegating to the existing copy() method. This is the appropriate implementation for a logging decorator class.

eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOsize.java (2)

31-31: LGTM! Consistent refactoring change.

The update from Attr.RHO to Phi.RHO is correct and maintains the same functionality while aligning with the PR objective to replace the Attr interface with Phi.


31-31: LGTM! Consistent with the Attr-to-Phi migration.

The replacement of Attr.RHO with Phi.RHO is correct and maintains the existing behavior while adopting the new Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOi16$EOas_i32.java (1)

34-34: LGTM! Correct migration from Attr.RHO to Phi.RHO.

This change correctly updates the constant reference as part of the migration from the legacy Attr interface to the unified Phi interface. The functionality remains unchanged.

eo-runtime/src/test/java/org/eolang/PhLoggedTest.java (1)

22-22: LGTM! Correct test reference migration.

The test assertion failure messages have been correctly updated to reference PhCompositeTest.TO_ADD_MESSAGE instead of AtCompositeTest.TO_ADD_MESSAGE, aligning with the migration from legacy At* classes to new Ph* classes.

Also applies to: 31-31, 40-40, 50-50

eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOacos.java (1)

30-30: LGTM! Consistent migration from Attr.RHO to Phi.RHO.

This change correctly updates the constant reference as part of the systematic migration from the legacy Attr interface to the unified Phi interface. The core mathematical logic remains unchanged.

eo-runtime/src/test/java/EOorg/EOeolang/EOnet/EOsocketTest.java (2)

34-34: LGTM! Correct import migration from AtVoid to PhVoid.

The import has been correctly updated to use the new PhVoid class as part of the migration from legacy At* classes to new Ph* classes implementing the Phi interface.


859-859: LGTM! Correct AtVoid to PhVoid migration in inner classes.

The migration from new AtVoid("s") to new PhVoid("s") in all four inner classes (Simple, Server, Receiver, Client) is correct. Based on the PhVoid class implementation, the constructor signature and functionality are compatible with the previous AtVoid usage.

Also applies to: 888-888, 917-917, 946-946

eo-runtime/src/test/java/org/eolang/ExInterruptedTest.java (1)

22-23: LGTM! Correct refactoring to new Phi interface.

The changes correctly replace the deprecated Attr.PHI constant with Phi.PHI and update the test message constant reference from AtCompositeTest to PhCompositeTest. The test logic remains unchanged while aligning with the new interface consolidation.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOdir$EOmade$EOmkdir.java (1)

34-34: LGTM! Correct migration to Phi interface.

The change correctly replaces Attr.RHO with Phi.RHO in the attribute access chain, maintaining the same functionality while aligning with the interface consolidation effort.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOopen$EOprocess_file.java (1)

33-35: LGTM! Consistent migration to Phi interface.

Both instances of Attr.RHO have been correctly replaced with Phi.RHO, maintaining the same attribute access patterns while conforming to the new interface consolidation. The file processing logic remains unchanged.

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOnot.java (1)

31-31:

Details

✅ Verification successful

LGTM! Correct refactoring to Phi interface.

The change correctly replaces Attr.RHO with Phi.RHO, maintaining the same functionality while aligning with the interface consolidation effort.

To ensure the refactoring is complete, let's verify that no remaining Attr references exist in the codebase:


🏁 Script executed:

#!/bin/bash
# Description: Verify that all Attr references have been successfully migrated to Phi
# Expected: No remaining references to Attr.RHO, Attr.PHI, Attr.LAMBDA, or AtVoid/AtComposite classes

echo "Checking for remaining Attr constant references..."
rg "Attr\.(RHO|PHI|LAMBDA)" --type java

echo "Checking for remaining deprecated attribute classes..."
rg "(AtVoid|AtComposite|AtOnce|AtRho|AtWithRho|AtLogged)" --type java

echo "Checking for import statements of deprecated classes..."
rg "import.*\.(Attr|AtVoid|AtComposite)" --type java

Length of output: 519


🏁 Script executed:

#!/bin/bash
# Broader search for any remaining Attr references
echo "Scanning for any 'Attr.' usage in Java sources..."
rg "Attr\." --type java || echo "No direct Attr.* references found."

echo "Scanning for any import statements mentioning Attr"
rg "import\s+.*Attr" --type java || echo "No Attr imports detected."

Length of output: 426


Refactoring Complete: No Remaining Attr References

The replacement of Attr.RHO with Phi.RHO in eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOnot.java correctly preserves functionality and aligns with the consolidated Phi interface. A repository-wide scan confirms:

  • No occurrences of Attr.* in Java sources
  • No import statements referencing Attr or deprecated attribute classes

All Attr references have been successfully migrated.

eo-runtime/src/test/java/org/eolang/DataTest.java (1)

20-20:

Details

✅ Verification successful

Verify the new message constant exists and maintains the same meaning.

The consistent replacement of AtCompositeTest.TO_ADD_MESSAGE with PhCompositeTest.TO_ADD_MESSAGE aligns with the broader refactoring. However, please ensure that PhCompositeTest.TO_ADD_MESSAGE provides the same assertion failure context as the original constant.

Also applies to: 33-33, 38-38, 43-43, 48-48


🏁 Script executed:

#!/bin/bash
# Verify that PhCompositeTest.TO_ADD_MESSAGE exists and check its value
rg -A 2 -B 2 "TO_ADD_MESSAGE.*=" --type java

Length of output: 897


🏁 Script executed:

#!/bin/bash
# Locate AtCompositeTest and display its TO_ADD_MESSAGE constant
file=$(rg -l "class AtCompositeTest" --type java)
echo "Found AtCompositeTest file: $file"
rg -n "public static final String TO_ADD_MESSAGE" "$file"

Length of output: 215


PhCompositeTest.TO_ADD_MESSAGE confirmed

  • Verified that PhCompositeTest.TO_ADD_MESSAGE is defined in eo-runtime/src/test/java/org/eolang/PhCompositeTest.java as
    public static final String TO_ADD_MESSAGE = "TO ADD ASSERTION MESSAGE";
  • The value matches the original AtCompositeTest constant, ensuring identical assertion context.

No further changes required.

eo-runtime/src/test/java/org/eolang/BytesOfTest.java (1)

27-27: LGTM! Consistent message constant updates.

All assertion message constants have been systematically updated from AtCompositeTest.TO_ADD_MESSAGE to PhCompositeTest.TO_ADD_MESSAGE, maintaining consistency with the broader refactoring from At* to Ph* classes.

Also applies to: 37-37, 47-47, 57-57, 66-66, 75-75, 85-85, 95-95, 107-107, 124-124, 146-146, 158-158

eo-runtime/src/main/java/org/eolang/PhOnce.java (1)

99-102: LGTM! Proper interface implementation.

The new copy(Phi self) override correctly implements the extended Phi interface by delegating to the existing copy() method. For PhOnce, ignoring the self parameter is appropriate since the lazy evaluation semantics remain consistent regardless of context.

eo-runtime/src/main/java/org/eolang/Data.java (1)

104-107: LGTM! Consistent interface implementation.

The new copy(Phi self) override properly implements the extended Phi interface by delegating to the existing copy() method. This delegation pattern is appropriate for the ToPhi wrapper class and maintains consistency with other Phi implementations in this refactoring.

eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOas_i64.java (1)

35-35: LGTM! Correct constant replacement as part of Attr → Phi refactoring.

The change from Attr.RHO to Phi.RHO is consistent with the broader refactoring effort to replace the deprecated Attr interface with the unified Phi interface.

eo-runtime/src/main/java/org/eolang/PhSafe.java (1)

160-163: LGTM! Correct implementation of new Phi interface method.

The new copy(Phi self) method correctly implements the updated Phi interface requirement by delegating to the existing parameterless copy() method. This maintains backward compatibility while supporting the new interface signature.

eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOasin.java (1)

30-30: LGTM! Consistent constant replacement in math operation.

The change from Attr.RHO to Phi.RHO is correct and maintains the existing arcsine calculation logic while aligning with the Attr → Phi interface refactoring.

eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOangle$EOsin.java (1)

31-31: LGTM! Final consistent constant replacement completing the refactoring pattern.

The change from Attr.RHO to Phi.RHO is correct and maintains the existing sine calculation logic. This completes the consistent pattern of Attr → Phi interface refactoring across all reviewed math operation files.

eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOsqrt.java (1)

30-30: LGTM: Correct Attr to Phi migration.

The replacement of Attr.RHO with Phi.RHO is correct and aligns with the systematic refactoring to remove the legacy Attr interface in favor of the unified Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOdeleted$EOdelete.java (1)

36-36: LGTM: Correct Attr to Phi migration in chained attribute access.

The replacement of Attr.RHO with Phi.RHO in the chained attribute access pattern is correct and maintains the same semantics for navigating the nested object hierarchy to reach the "path" attribute.

eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOpow.java (2)

15-15: LGTM: Correct migration from AtVoid to PhVoid.

The replacement of AtVoid with PhVoid in the import and constructor is correct. The new PhVoid class provides equivalent functionality with improved thread-safety using AtomicReference and consistent error handling for uninitialized access.

Also applies to: 33-33


40-40: LGTM: Correct Attr to Phi constant migration.

The replacement of Attr.RHO with Phi.RHO maintains the same attribute access semantics while aligning with the unified Phi interface approach.

eo-runtime/src/test/java/org/eolang/PhiTest.java (1)

21-21: LGTM: Correct test constant migration.

The systematic replacement of AtCompositeTest.TO_ADD_MESSAGE with PhCompositeTest.TO_ADD_MESSAGE across all test methods correctly aligns the test assertions with the new PhComposite class structure while maintaining the same test logic and validation.

Also applies to: 52-52, 71-71, 82-82, 98-98

eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOreal$EOln.java (1)

30-30: Consistent replacement of attribute constant
Replacing the deprecated Attr.RHO with Phi.RHO aligns this method with the new Phi-based attribute API. The natural logarithm logic remains untouched.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOis_directory.java (1)

34-34: Unified attribute constant usage
Switching from Attr.RHO to Phi.RHO properly follows the new convention for root attribute access; functionality is preserved.

eo-runtime/src/main/java/EOorg/EOeolang/EOmath/EOangle$EOcos.java (1)

31-31: Correct migration to Phi interface
The update to use Phi.RHO for attribute retrieval is in line with the broader refactoring. The cosine calculation itself remains correct.

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOsize.java (1)

30-30: Appropriate constant replacement
Replacing Attr.RHO with Phi.RHO keeps the byte‐array size logic intact while ensuring consistency with the new attribute handling model.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOtouched$EOtouch.java (1)

34-34: Attribute constant references updated
The nested .take() calls now consistently use Phi.RHO instead of Attr.RHO, preserving the original behavior of resolving the file path.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOdir$EOtmpfile$EOtouch.java (1)

36-36: LGTM: Correct migration from Attr to Phi interface.

The replacement of Attr.RHO with Phi.RHO correctly aligns with the refactoring to remove the legacy Attr interface in favor of the unified Phi interface.

eo-runtime/src/test/java/org/eolang/ExpectTest.java (1)

158-272: LGTM: Consistent test updates for Phi interface migration.

All test methods have been correctly updated to use Phi.RHO instead of Attr.RHO. The test logic remains unchanged - these are purely mechanical replacements that maintain the same functionality while using the new interface.

eo-runtime/src/test/java/org/eolang/MainTest.java (1)

139-169: LGTM: Test constants updated for new PhComposite class.

The replacement of AtCompositeTest.TO_ADD_MESSAGE with PhCompositeTest.TO_ADD_MESSAGE correctly reflects the migration from AtComposite to PhComposite classes. The test assertions remain functionally identical.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOmoved$EOmove.java (1)

34-39: LGTM: Correct Phi interface migration in file operations.

The replacement of Attr.RHO with Phi.RHO correctly updates the attribute access pattern while maintaining the same file move operation logic. This change aligns with the broader refactoring to use the unified Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOfloor.java (1)

31-31: LGTM! Consistent with the Attr → Phi migration.

The replacement of Attr.RHO with Phi.RHO is correct and aligns with the broader refactoring to consolidate attribute handling under the Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOsize.java (1)

33-33: LGTM! Proper constant migration from Attr to Phi.

The change from Attr.RHO to Phi.RHO maintains the same functionality while adopting the new unified Phi interface constants.

eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOsscanf.java (2)

24-24: LGTM! Proper import for the new PhVoid class.

The import of PhVoid is correctly added to support the migration from AtVoid to the new Phi-based attribute system.


59-61: LGTM! Successful migration from AtVoid to PhVoid.

The replacement of AtVoid with PhVoid for both "format" and "read" attributes is correct. Based on the PhVoid implementation in the codebase (lines 18-137 in PhVoid.java), this new class provides equivalent functionality with proper error handling for unset attributes and read-only protection, while implementing the unified Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOsprintf.java (2)

25-25: LGTM! Correct import for PhVoid class.

The import statement properly includes PhVoid to support the attribute system migration from AtVoid to the new Phi-based architecture.


60-61: LGTM! Proper AtVoid to PhVoid migration.

The constructor correctly replaces AtVoid instances with PhVoid for both "format" and "args" attributes. This change aligns with the broader refactoring to unify attribute handling under the Phi interface, and PhVoid provides equivalent functionality with improved consistency across the codebase.

eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOtimes.java (3)

16-16: LGTM: Import updated for new attribute system.

The import correctly adds PhVoid as part of the migration from the legacy Attr interface to the new Phi interface system.


34-34: LGTM: Attribute initialization updated to use PhVoid.

The constructor correctly replaces AtVoid with PhVoid while maintaining the same attribute name parameter. This change aligns with the broader refactoring to use the new Phi-based attribute system.


39-39: LGTM: Constant reference updated for new interface.

The change from Attr.RHO to Phi.RHO correctly updates the constant reference to match the new Phi interface system while preserving the same functionality for accessing the root object.

eo-runtime/src/main/java/EOorg/EOeolang/EOtxt/EOregex$EOpattern$EOmatch$EOmatched_from_index.java (3)

22-22: LGTM: Import updated for new attribute system.

The import correctly adds PhVoid as part of the migration from the legacy Attr interface to the new Phi interface system.


53-53: LGTM: Attribute initialization updated to use PhVoid.

Both attribute initializations correctly replace AtVoid with PhVoid while maintaining the same attribute name parameters (POSITION and START). This change aligns with the broader refactoring to use the new Phi-based attribute system.

Also applies to: 57-57


63-63: LGTM: Constant references updated for new interface.

Both changes from Attr.RHO to Phi.RHO correctly update the constant references to match the new Phi interface system while preserving the same functionality for accessing root and nested objects.

Also applies to: 65-65

eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOwrite.java (3)

16-16: LGTM: Import updated for new attribute system.

The import correctly adds PhVoid as part of the migration from the legacy Attr interface to the new Phi interface system.


33-34: LGTM: Attribute initialization updated to use PhVoid.

Both attribute initializations correctly replace AtVoid with PhVoid while maintaining the same attribute name parameters ("offset" and "data"). This change aligns with the broader refactoring to use the new Phi-based attribute system.


40-40: LGTM: Constant reference updated for new interface.

The change from Attr.RHO to Phi.RHO correctly updates the constant reference to match the new Phi interface system while preserving the same functionality for accessing the parent object.

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOeq.java (3)

17-17: LGTM: Import updated for new attribute system.

The import correctly adds PhVoid as part of the migration from the legacy Attr interface to the new Phi interface system.


35-35: LGTM: Attribute initialization updated to use PhVoid.

The constructor correctly replaces AtVoid with PhVoid while maintaining the same attribute name parameter ("b"). This change aligns with the broader refactoring to use the new Phi-based attribute system.


45-45: LGTM: Constant reference updated for new interface.

The change from Attr.RHO to Phi.RHO correctly updates the constant reference to match the new Phi interface system while preserving the same functionality for accessing the root object.

eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOplus.java (3)

16-16: LGTM! Correct import addition for new PhVoid class.

The import statement correctly adds PhVoid to support the migration from AtVoid.


34-34: LGTM! Proper migration from AtVoid to PhVoid.

The constructor correctly initializes the "x" attribute using PhVoid instead of the deprecated AtVoid. This change is consistent with the broader refactoring effort.


39-39: LGTM! Correct migration from Attr.RHO to Phi.RHO.

The lambda method correctly uses Phi.RHO instead of the deprecated Attr.RHO for accessing the parent object attribute. This maintains the same functionality while using the new interface.

eo-runtime/src/test/java/org/eolang/PhPackageTest.java (2)

35-35: LGTM! Correct migration of test message constants.

All references to AtCompositeTest.TO_ADD_MESSAGE have been properly updated to PhCompositeTest.TO_ADD_MESSAGE, reflecting the migration from the old AtComposite class to the new PhComposite class.

Also applies to: 73-73, 82-82, 94-94, 105-105, 131-131


49-49: LGTM! Correct migration from Attr.RHO to Phi.RHO.

All attribute references have been properly updated from Attr.RHO to Phi.RHO, maintaining the same test semantics while using the new interface. This ensures the tests remain valid for the migrated codebase.

Also applies to: 52-52, 62-63, 74-74

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOslice.java (3)

18-18: LGTM! Correct import addition for new PhVoid class.

The import statement correctly adds PhVoid to support the migration from AtVoid.


36-37: LGTM! Proper migration from AtVoid to PhVoid for multiple attributes.

The constructor correctly initializes both "start" and "len" attributes using PhVoid instead of the deprecated AtVoid. This change is consistent with the broader refactoring effort and maintains the same attribute initialization semantics.


62-62: LGTM! Correct migration from Attr.RHO to Phi.RHO.

The lambda method correctly uses Phi.RHO instead of the deprecated Attr.RHO for accessing the parent bytes object. This maintains the same functionality while using the new interface.

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOand.java (3)

16-16: LGTM! Correct import addition for new PhVoid class.

The import statement correctly adds PhVoid to support the migration from AtVoid.


34-34: LGTM! Proper migration from AtVoid to PhVoid.

The constructor correctly initializes the "b" attribute using PhVoid instead of the deprecated AtVoid. This change is consistent with the broader refactoring effort.


40-40: LGTM! Correct migration from Attr.RHO to Phi.RHO.

The lambda method correctly uses Phi.RHO instead of the deprecated Attr.RHO for accessing the parent bytes object. This maintains the same bitwise AND operation functionality while using the new interface.

eo-runtime/src/main/java/org/eolang/PhPackage.java (2)

56-59: LGTM: Consistent implementation of copy method.

The addition of copy(Phi self) method correctly delegates to the existing copy() method, following the pattern established in other Phi implementations as mentioned in the AI summary.


75-82: LGTM: Correct migration from Attr.RHO to Phi.RHO.

All references to Attr.RHO have been consistently updated to Phi.RHO including in the conditional check, map operations, and error message. This maintains the same logic while using the new constant location.

Also applies to: 97-97

eo-runtime/src/test/java/org/eolang/PhWithTest.java (3)

28-28: LGTM: Consistent test message constant updates.

All test assertion messages have been correctly updated from AtCompositeTest.TO_ADD_MESSAGE to PhCompositeTest.TO_ADD_MESSAGE, reflecting the test class rename in the refactoring.

Also applies to: 36-36, 48-48, 69-69, 84-84


104-104: LGTM: Correct migration from AtVoid to PhVoid.

The change from AtVoid to PhVoid maintains the same void attribute functionality while using the new Phi-based implementation.


119-119: LGTM: Correct migration from AtComposite to PhComposite.

The change from AtComposite to PhComposite maintains the same composite attribute functionality with the same lambda parameter, now using the new Phi-based implementation.

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOor.java (2)

16-16: LGTM: Correct migration from AtVoid to PhVoid.

The import and constructor have been correctly updated to use PhVoid instead of AtVoid. Based on the relevant code snippets, PhVoid implements the same void attribute functionality as AtVoid but using the new Phi interface.

Also applies to: 34-34


40-40: LGTM: Correct constant migration.

The change from Attr.RHO to Phi.RHO is consistent with the refactoring and maintains the same functionality for accessing the rho attribute.

eo-runtime/src/test/java/EOorg/EOeolang/EOnumberTest.java (2)

15-15: LGTM: Consistent test updates for renamed test class.

The import and all test assertion messages have been correctly updated from AtCompositeTest to PhCompositeTest, reflecting the test class rename in the refactoring.

Also applies to: 37-37, 46-46, 55-55


77-77: LGTM: Correct constant migration in parameterized tests.

The changes from Attr.RHO to Phi.RHO in both parameterized tests are consistent with the refactoring and maintain the same test logic for verifying error messages with the rho attribute.

Also applies to: 107-107

eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOdiv.java (3)

16-16: LGTM: Import updated for new Phi-based architecture.

The import correctly changes from the deprecated AtVoid to the new PhVoid class as part of the Attr→Phi interface migration.


34-34: LGTM: Constructor updated to use PhVoid.

The attribute initialization correctly migrated from AtVoid to PhVoid. Based on the relevant code snippet from PhVoid.java, this maintains the same functionality while using the new Phi-based architecture.


39-39: LGTM: Constant reference updated to Phi interface.

The change from Attr.RHO to Phi.RHO is consistent with the migration to the unified Phi interface and maintains the same functionality.

eo-runtime/src/test/java/EOorg/EOeolang/HeapsTest.java (3)

14-17: LGTM: Test imports updated for Phi-based architecture.

The import statements correctly migrate from the deprecated AtComposite, AtCompositeTest, and AtVoid to their new PhComposite, PhCompositeTest, and PhVoid counterparts.


41-41: LGTM: Test message constants updated consistently.

All test assertions correctly migrated from AtCompositeTest.TO_ADD_MESSAGE to PhCompositeTest.TO_ADD_MESSAGE, maintaining consistent test messaging across the refactored codebase.

Also applies to: 53-53, 62-62, 75-75, 87-87, 96-96, 106-106, 115-115, 128-128, 140-140, 151-151, 165-165, 174-174


279-280: LGTM: Test helper class updated to use new Phi classes.

The PhFake constructor correctly migrated from AtVoid and AtComposite to PhVoid and PhComposite, maintaining the same test functionality while using the new architecture.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOopen$EOfile_stream$EOread$EOread_bytes.java (3)

18-18: LGTM: Import updated for new Phi-based architecture.

The import correctly changes from AtVoid to PhVoid as part of the systematic Attr→Phi interface migration.


39-39: LGTM: Attribute initialization updated to use PhVoid.

The "size" attribute initialization correctly migrated from AtVoid to PhVoid, maintaining the same void attribute semantics with the new Phi-based architecture.


46-49: LGTM: RHO constant references updated consistently.

The chained take(Phi.RHO) calls correctly migrated from Attr.RHO to Phi.RHO, maintaining the same attribute traversal functionality while using the unified Phi interface.

eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl (4)

369-371: LGTM: Void template updated to generate PhVoid.

The XSL template correctly updates void element generation from AtVoid to PhVoid, ensuring transpiled EO code uses the new Phi-based architecture.


399-425: LGTM: Atom template updated to use PhCached and PhComposite.

The template correctly migrates from AtOnce(AtComposite(...)) to PhCached(PhComposite(...)), maintaining the same caching and composition semantics while using the new Phi-based classes.


435-468: LGTM: Abstract template updated to use PhCached and PhComposite.

The template correctly updates abstract object generation from the deprecated AtOnce(AtComposite(...)) pattern to PhCached(PhComposite(...)), maintaining lazy evaluation and caching functionality.


476-497: LGTM: Bound template updated to use PhCached and PhComposite.

The template correctly migrates bound object generation to use PhCached(PhComposite(...)) instead of AtOnce(AtComposite(...)), completing the transpiler migration to the new Phi-based architecture.

eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOtimes.java (3)

17-17: LGTM: Correct import for the new PhVoid class.

The import change from AtVoid to PhVoid is consistent with the systematic migration from the Attr interface to the Phi interface.


34-34: LGTM: Correct migration from AtVoid to PhVoid.

The constructor change properly replaces AtVoid with PhVoid while maintaining the same parameter pattern. The PhVoid class provides equivalent functionality within the new Phi-based architecture.


44-44: LGTM: Correct migration from Attr.RHO to Phi.RHO.

The change properly updates the root object access to use the new Phi.RHO constant instead of the removed Attr.RHO. This maintains the same functionality while using the new interface.

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOxor.java (2)

16-16: LGTM: Consistent migration pattern from AtVoid to PhVoid.

The import addition and constructor change follow the same systematic migration pattern seen across the codebase, replacing AtVoid with PhVoid consistently.

Also applies to: 34-34


40-40: LGTM: Consistent migration from Attr.RHO to Phi.RHO.

The attribute access change maintains consistency with the systematic migration across the codebase.

eo-integration-tests/src/test/java/integration/SnippetIT.java (2)

25-25: LGTM: Appropriate temporary disabling of integration tests.

The @Disabled annotation is correctly applied to prevent test failures during the migration period.

Also applies to: 37-37


32-35: Excellent documentation for temporary test disabling.

The TODO comment provides clear and comprehensive explanation for why the tests are disabled, what specific dependency issue causes the failure, and when they should be re-enabled. This is exactly how temporary test disabling should be documented.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOfile$EOopen$EOfile_stream$EOwrite$EOwritten_bytes.java (2)

19-19: LGTM: Consistent migration pattern for PhVoid.

The import and constructor changes follow the same systematic migration pattern, replacing AtVoid with PhVoid for the "buffer" attribute.

Also applies to: 40-40


47-50: LGTM: Correct migration of chained attribute access.

The chained .take(Phi.RHO) calls properly navigate through the nested object hierarchy, consistently replacing Attr.RHO with Phi.RHO throughout the chain to access the "path" attribute.

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOconcat.java (3)

16-16: Import change looks correct.

The import of PhVoid is appropriate for the refactoring from AtVoid to PhVoid.


34-34: Constructor update is correct.

The replacement of AtVoid with PhVoid for the "b" attribute is consistent with the architectural migration and maintains the same semantics.


39-39: Constant usage update is correct.

The change from Attr.RHO to Phi.RHO aligns with the interface migration and maintains the same functionality for accessing the root object.

eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOdiv.java (3)

17-17: Import addition is correct.

The PhVoid import is properly added to support the refactoring from AtVoid.


34-34: Attribute initialization updated correctly.

The change from AtVoid to PhVoid for the "x" attribute maintains the same void attribute semantics while using the new interface.


44-44: Root object access updated correctly.

The migration from Attr.RHO to Phi.RHO is consistent with the interface refactoring and preserves the same functionality for accessing the root object in the division operation.

eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOright.java (3)

16-16: Import update is appropriate.

The addition of PhVoid import supports the migration from the legacy AtVoid class.


34-34: Attribute creation updated correctly.

The replacement of AtVoid with PhVoid for the "x" attribute is consistent with the architectural changes and maintains the same void attribute behavior.


40-40: Root object constant updated correctly.

The change from Attr.RHO to Phi.RHO correctly follows the interface migration pattern and preserves the functionality for accessing the root object in the byte shift operation.

eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOgt.java (3)

15-15: Import addition is correct.

The PhVoid import is properly added to support the migration from AtVoid.


33-33: Constructor change is correct.

The replacement of AtVoid with PhVoid for the "x" attribute follows the established refactoring pattern and maintains the same semantics.


39-39: Root object access updated correctly.

The change from Attr.RHO to Phi.RHO is consistent with the interface migration and maintains the same functionality for accessing the root object in the comparison operation.

eo-runtime/src/test/java/EOorg/EOeolang/EOerrorTest.java (3)

17-19: LGTM! Import updates align with the Attr to Phi migration.

The import statements have been correctly updated to use the new PhCached, PhComposite, and PhCompositeTest classes instead of their At* counterparts.


50-50: Correct update of test assertion message constant.

The test assertion message has been properly updated to reference PhCompositeTest.TO_ADD_MESSAGE instead of the deprecated AtCompositeTest.TO_ADD_MESSAGE.


103-104: Proper migration from AtOnce/AtComposite to PhCached/PhComposite.

The constructor calls have been correctly updated to use the new PhCached and PhComposite classes while maintaining the same nesting structure and functionality.

eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOplus.java (3)

17-17: Import correctly updated for the new PhVoid class.

The import has been properly updated to use org.eolang.PhVoid instead of the deprecated AtVoid class.


35-35: Attribute initialization migrated to PhVoid.

The attribute initialization has been correctly updated to use new PhVoid("x") instead of new AtVoid("x"). Based on the provided code snippets, PhVoid provides equivalent functionality for void attribute handling.


46-46: Constant reference correctly migrated from Attr to Phi.

The RHO constant reference has been properly updated from Attr.RHO to Phi.RHO, aligning with the migration of attribute constants to the Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOnumber$EOgt.java (3)

16-16: Import statement correctly updated for PhVoid.

The import has been properly updated to use the new PhVoid class instead of the deprecated AtVoid.


34-34: Attribute initialization correctly migrated.

The void attribute initialization has been properly updated to use new PhVoid("x"), maintaining the same semantics while using the new class hierarchy.


39-39: RHO constant reference properly migrated.

The constant reference has been correctly updated from Attr.RHO to Phi.RHO, consistent with the overall migration to the Phi interface.

eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java (4)

15-19: Import statements correctly updated for the new class hierarchy.

All import statements have been properly updated to use the new PhComposite, PhCompositeTest, and PhVoid classes instead of their deprecated At* counterparts.


44-44: Test assertion messages consistently updated.

All test assertion messages have been properly updated to reference PhCompositeTest.TO_ADD_MESSAGE instead of the deprecated AtCompositeTest.TO_ADD_MESSAGE, ensuring consistency across the test file.

Also applies to: 59-59, 64-64


96-96: Void attribute initialization correctly migrated.

Both Dummy and ErrorDummy classes have been properly updated to use new PhVoid("m") instead of new AtVoid("m") for attribute initialization.

Also applies to: 127-127


98-99: Phi constant and composite construction properly migrated.

The constant references have been correctly updated from Attr.PHI to Phi.PHI, and the composite object construction has been properly updated to use new PhComposite(...) instead of new AtComposite(...).

Also applies to: 129-130

eo-runtime/src/test/java/org/eolang/PhaSimple.java (3)

21-21: LGTM! Correct class inheritance update.

The class properly extends PhaEnvelope instead of the removed AtEnvelope, maintaining the same wrapper pattern for the new Phi-based architecture.


25-27: LGTM! Constructor properly updated.

The no-argument constructor correctly delegates to the parameterized constructor while maintaining the same behavior with Phi.Φ.


33-35: LGTM! Correct migration to PhComposite.

The constructor parameter and superclass call have been properly updated to use PhComposite instead of AtComposite, maintaining the same functional behavior while adopting the new Phi-based attribute model.

eo-runtime/src/main/java/EOorg/EOeolang/EOfs/EOdir$EOwalk.java (3)

23-23: LGTM! Correct import update.

The import has been properly updated from AtVoid to PhVoid as part of the Attr → Phi migration.


41-41: LGTM! Proper PhVoid attribute initialization.

The attribute is correctly initialized with PhVoid instead of AtVoid. Based on the PhVoid implementation, this maintains the same lazy initialization semantics while implementing the new Phi interface.


48-48: LGTM! Correct constant migration.

The root object access has been properly updated from Attr.RHO to Phi.RHO, aligning with the migration of constants to the Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOread.java (3)

16-16: LGTM! Correct import update.

The import has been properly updated from AtVoid to PhVoid as part of the comprehensive Attr → Phi interface migration.


33-34: LGTM! Proper attribute initialization with PhVoid.

Both "offset" and "length" attributes are correctly initialized using PhVoid instead of AtVoid. This maintains the same lazy initialization behavior while implementing the new Phi interface, ensuring consistency with the broader refactoring.


41-41: LGTM! Correct root object access.

The code properly uses Phi.RHO instead of Attr.RHO to access the root object's "id" attribute, consistent with the migration of constants to the Phi interface.

eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOresized.java (3)

16-16: LGTM! Correct import update.

The import has been properly updated from AtVoid to PhVoid, maintaining consistency with the Attr → Phi interface migration across the codebase.


33-33: LGTM! Proper PhVoid attribute initialization.

The "new-size" attribute is correctly initialized using PhVoid instead of AtVoid. This preserves the lazy initialization semantics while adopting the new Phi interface implementation.


38-38: LGTM! Correct root object access pattern.

The code properly uses Phi.RHO instead of Attr.RHO to access the root object, completing the migration from the legacy Attr constants to the new Phi interface constants.

eo-runtime/src/test/java/org/eolang/PhaLoggedTest.java (4)

19-28: LGTM: Class rename and field declarations are consistent.

The refactoring from AtLoggedTest to PhaLoggedTest is correctly implemented with proper field type updates to use the new Pha* classes.


59-65: LGTM: Object initialization updated correctly.

The test setup properly uses the new PhaSimple, PhaLogged, and PhVoid classes instead of their At* predecessors.


104-104: LGTM: Put method signature updated correctly.

The put method call is correctly updated to use the new signature put("start", Phi.Φ) which accepts a key-value pair instead of a single argument.


87-89:

Details

✅ Verification successful

Verify method signature change from get() to take(0).

The test correctly updates from get() to take(0) method calls, which aligns with the new Phi interface. However, ensure this change is semantically equivalent across all implementations.


🏁 Script executed:

#!/bin/bash
# Description: Verify that take(0) is the correct replacement for get() in Phi implementations

# Search for get() method implementations in old Attr classes to understand the semantics
rg -A 5 "public.*get\(\)" --type java

# Search for take(0) method implementations in new Phi classes
rg -A 5 "public.*take\(.*int.*\)" --type java

Length of output: 11148


Confirm take(0) correctly replaces legacy get()
All Phi.take(int) overrides—including PhaLogged.take(0)—delegate to the same 0th attribute as the old get(), yielding identical behavior. No further changes needed.

eo-runtime/src/test/java/org/eolang/PhCompositeTest.java (2)

35-42: LGTM: Test logic updated correctly for new PhComposite class.

The test instantiation and method call are properly updated to use PhComposite and take(0) instead of the previous AtComposite and get().


48-70: LGTM: Method signature and constants updated consistently.

The test correctly uses:

  • PhMethod with Phi.LAMBDA constant (instead of Attr.LAMBDA)
  • Proper reference to PhCompositeTest.TO_ADD_MESSAGE
eo-runtime/src/test/java/EOorg/EOeolang/EOtryTest.java (6)

15-21: LGTM: Import statements updated consistently.

All imports have been correctly updated to use the new Ph* classes:

  • PhComposite instead of AtComposite
  • PhCompositeTest instead of AtCompositeTest
  • PhVoid instead of AtVoid

78-78: LGTM: Test message constant reference updated.

The reference to PhCompositeTest.TO_ADD_MESSAGE is correctly updated from the previous AtCompositeTest.TO_ADD_MESSAGE.


128-136: LGTM: Inner class MainWithCounter updated correctly.

The class properly uses:

  • Phi.PHI constant instead of Attr.PHI
  • PhComposite instead of AtComposite

The logic and structure remain unchanged, which preserves test behavior.


153-159: LGTM: Inner class Main updated correctly.

The Main class correctly uses PhComposite instead of AtComposite while preserving the same test logic.


175-181: LGTM: Inner class Broken updated correctly.

The Broken class correctly uses PhComposite instead of AtComposite for exception testing.


195-202: LGTM: Inner class Catcher updated correctly.

The Catcher class properly uses:

  • PhVoid instead of AtVoid
  • PhComposite instead of AtComposite
eo-runtime/src/main/java/org/eolang/Phi.java (2)

22-36: LGTM: Attribute constants correctly defined.

The three constants are properly defined with their corresponding Unicode values:

  • LAMBDA = "λ"
  • PHI = "φ" (with appropriate PMD suppression)
  • RHO = "ρ"

The PMD suppression for PHI is justified since this field intentionally matches the interface name by design.


99-108:

Details

✅ Verification successful

Address the TODO comment for temporary copy(Phi self) method.

The new copy(Phi self) method includes a TODO comment indicating it should be removed after the refactoring is complete. This suggests it's a temporary bridge method during the transition from Attr to Phi.

Consider creating an issue to track the removal of this temporary method once the refactoring is fully complete.


🏁 Script executed:

#!/bin/bash
# Description: Check if copy(Phi self) method is still needed across the codebase

# Search for usages of copy(Phi) method
rg "\.copy\(" --type java -A 2 -B 2

# Search for PhDefault.copy() implementation to understand the dependency
ast-grep --pattern 'class PhDefault {
  $$$
  copy() {
    $$$
  }
  $$$
}'

Length of output: 64725


Keep copy(Phi self) as a temporary bridge—still widely used
We’ve confirmed that the Phi.copy(Phi self) method is invoked across the codebase—in core implementations (e.g. PhEnvelope, PhCached, PhWithRho) and in scores of tests—and cannot yet be removed. The existing

@todo #3480:45min Remove Phi.copy(Phi) method from the interface.

remains valid. Please keep the TODO and open an issue (tracking #3480) to schedule its removal once all callers have migrated to Phi.copy().

eo-runtime/src/main/java/org/eolang/PhDefault.java (1)

150-161: Potentially incomplete value retrieval via take(name)

take(name) returns attrs.get(name).take(0), ignoring name.
After the Attr→Phi migration, position 0 is not guaranteed to yield the attribute’s value; it might be a lambda/placeholder. This mirrors the issue noted in PhWithRho.

Please review whether the original behaviour should instead be:

object = this.attrs.get(name).take(name);

or simply:

object = this.attrs.get(name);

If the current design is intentional, add explanatory Javadoc to prevent future regressions.

eo-runtime/src/test/java/org/eolang/PhDefaultTest.java (3)

64-65: LGTM! Correct migration from Attr to Phi constants.

The systematic replacement of Attr.RHO and Attr.PHI with Phi.RHO and Phi.PHI correctly reflects the migration from the deprecated Attr interface to the unified Phi interface.

Also applies to: 73-75, 83-85, 119-123, 130-131, 155-159, 163-167, 178-184, 192-195


516-517: LGTM! Proper replacement of legacy attribute classes.

The systematic replacement of At* classes (AtVoid, AtSimple, AtOnce, AtComposite) with their new Ph* counterparts (PhVoid, PhaSimple, PhCached, PhComposite) correctly implements the architectural shift to the Phi-based attribute model.

Also applies to: 520-525, 529-541, 555-558, 571-571, 602-602, 616-617, 637-637, 671-672, 705-706


228-228: LGTM! Test message constants correctly updated.

The replacement of AtCompositeTest.TO_ADD_MESSAGE with PhCompositeTest.TO_ADD_MESSAGE properly aligns with the class renaming in the refactoring.

Also applies to: 238-238, 250-250, 255-255, 275-275, 301-301, 312-312, 326-326, 335-335, 346-346, 357-357, 371-371, 380-380, 408-408, 425-425, 467-467

eo-runtime/src/main/java/org/eolang/PhRho.java (1)

68-80: LGTM! Proper single-assignment semantics.

The put() methods correctly implement single-assignment semantics by only setting the rho if it's currently null, ignoring subsequent assignments.

eo-runtime/src/main/java/org/eolang/PhCached.java (2)

74-81: LGTM! Proper read-only enforcement.

The put() methods correctly throw ExReadOnly exceptions to prevent modification of cached attributes, which is the expected behavior for a caching wrapper.

Also applies to: 84-91


38-41: LGTM! Proper caching behavior in copy method.

The copy(Phi self) method correctly creates a new PhCached instance with the copied origin, ensuring that cached values are not shared between copies.

eo-runtime/src/main/java/org/eolang/PhComposite.java (5)

17-17: LGTM: Well-designed replacement for AtComposite.

The class design is clean and properly implements the Phi interface as part of the migration from the Attr-based system.


33-36: LGTM: Constructor implementation is correct.

The constructor properly initializes both the argument and expression fields, maintaining the context-dependent nature of the composite attribute.


64-68: LGTM: Proper read-only enforcement.

The put methods correctly throw ExReadOnly exceptions to enforce immutability of lambda expressions, which is the expected behavior for composite attributes.

Also applies to: 81-85


64-68: Proper read-only enforcement.

Correctly throws ExReadOnly to prevent mutation of the lambda expression, maintaining immutability.


81-85: Consistent read-only enforcement.

Properly prevents mutation attempts through positional assignment, maintaining the read-only nature of the composite attribute.

eo-runtime/src/main/java/org/eolang/PhVoid.java (8)

18-18: LGTM: Successful migration from AtVoid to PhVoid.

The class has been properly renamed and refactored to implement the Phi interface as part of the broader migration from the Attr-based system.


48-57: LGTM: Proper null handling in copy method.

The copy(Phi self) method correctly handles the case where the internal object might be null, ensuring safe copying behavior.


70-81: LGTM: Proper single-assignment semantics.

The put methods correctly implement single-assignment semantics with thread-safe checks and appropriate error messages when attempting to reassign.

Also applies to: 84-95


98-108: LGTM: Proper null checking in take methods.

Both take methods correctly check for null and throw ExUnset with descriptive error messages when the attribute is not initialized.

Also applies to: 121-131


116-118:

Details

✅ Verification successful

Verify hasRho() implementation.

The method always returns false. Please verify that this is correct for void attributes, or if it should delegate to the internal object when present.


🏁 Script executed:

#!/bin/bash
# Description: Search for other hasRho() implementations to understand the expected behavior
# Expected: Find patterns for how hasRho() should be implemented for void attributes

echo "Searching for hasRho implementations in Phi classes:"
rg -A 3 "hasRho\(\)" --type java

echo -e "\nSearching for documentation or comments about hasRho behavior:"
rg -A 5 -B 5 "hasRho|has.*rho" --type java

Length of output: 19027


No changes needed: PhVoid.hasRho() is correct
The void‐wrapper is meant to suppress any bound “rho” attribute, so always returning false here is intentional. On copy, PhVoid unwraps itself (via object.get().copy()), allowing the underlying object’s own hasRho() to be used thereafter.


98-108: Proper null checking and error handling.

The take(int pos) method correctly checks for null and provides a clear error message when the attribute is uninitialized.


121-131: Consistent null checking for named access.

The take(String nme) method properly mirrors the positional take method with appropriate null checking and error messages.


48-57: Good copy semantics with null handling.

The copy(Phi self) method properly handles the case where the internal object might be null, ensuring safe copying behavior.

Comment thread eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOgt.java Outdated
Comment thread eo-runtime/src/main/java/org/eolang/PhWithRho.java
Comment thread eo-runtime/src/main/java/org/eolang/PhWithRho.java
Comment thread eo-runtime/src/test/java/org/eolang/PhaEnvelope.java
Comment thread eo-runtime/src/main/java/org/eolang/PhaLogged.java Outdated
Comment thread eo-runtime/src/main/java/org/eolang/PhCached.java
Comment thread eo-runtime/src/main/java/org/eolang/PhVoid.java
Comment thread eo-runtime/src/main/java/org/eolang/PhVoid.java
Comment thread eo-runtime/src/main/java/org/eolang/PhVoid.java
Comment thread eo-runtime/src/main/java/org/eolang/PhVoid.java
@h1alexbel

Copy link
Copy Markdown
Member Author

@maxonfjvipon updated. Take a look, please

@h1alexbel
h1alexbel requested a review from maxonfjvipon June 2, 2025 18:49
@yegor256

yegor256 commented Jun 3, 2025

Copy link
Copy Markdown
Member

@h1alexbel what do you think about suggestions made by the Rabbit above? Some of them look reasonable to me.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (2)
eo-runtime/src/main/java/org/eolang/PhWithRho.java (2)

37-40: LGTM! Previous issue with copy() has been resolved.

The copy() method now correctly returns a new PhWithRho instance that preserves the wrapper behavior, addressing the previous concern about losing the RHO-propagating wrapper.


48-65: LGTM! Previous issue with take() methods has been resolved.

Both take(String name) and take(int pos) methods now correctly use their respective parameters (name and pos) instead of the hardcoded 0, addressing the previous functional bug. The logic for auto-injecting rho when attributes don't have it is also implemented correctly.

🧹 Nitpick comments (3)
eo-runtime/src/main/java/org/eolang/PhWithRho.java (3)

32-35: Consider adding null safety checks.

The constructor doesn't validate that attr and rho parameters are non-null. While this might be intentional if null values are valid in the EO runtime, consider adding documentation or validation if null values could cause issues downstream.

 PhWithRho(final Phi attr, final Phi rho) {
+    if (attr == null) {
+        throw new IllegalArgumentException("attr cannot be null");
+    }
+    if (rho == null) {
+        throw new IllegalArgumentException("rho cannot be null");
+    }
     this.original = attr;
     this.rho = rho;
 }

11-13: Address the TODO comment about moving origin() method.

The TODO comment indicates that the origin() method should be moved elsewhere to reduce the method count and eliminate the PMD violation. This refactoring could improve the class design.

Would you like me to suggest an alternative design pattern or help identify where this method could be moved to address the TooManyMethods PMD violation?

Also applies to: 104-106


50-53: Consider performance implications of frequent copying.

The take() methods create a copy of the attribute when injecting rho. While this preserves immutability and avoids side effects, it could impact performance if called frequently in hot paths.

Consider documenting this behavior or exploring alternatives like lazy rho injection if performance becomes a concern:

// Current approach: always copy when injecting rho
if (!ret.hasRho()) {
    ret = ret.copy();  // This creates a new instance
    ret.put(Phi.RHO, this.rho);
}

Also applies to: 60-63

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd2045d and 8e8189e.

📒 Files selected for processing (4)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOgt.java (2 hunks)
  • eo-runtime/src/main/java/org/eolang/PhCached.java (1 hunks)
  • eo-runtime/src/main/java/org/eolang/PhVoid.java (4 hunks)
  • eo-runtime/src/main/java/org/eolang/PhWithRho.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • eo-runtime/src/main/java/EOorg/EOeolang/EOi64$EOgt.java
  • eo-runtime/src/main/java/org/eolang/PhCached.java
  • eo-runtime/src/main/java/org/eolang/PhVoid.java
⏰ Context from checks skipped due to timeout of 90000ms (12)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: ort
  • GitHub Check: benchmark
  • GitHub Check: qulice
  • GitHub Check: integration
  • GitHub Check: mvn (macos-15, 23)
  • GitHub Check: mvn (ubuntu-24.04, 11)
  • GitHub Check: mvn (ubuntu-24.04, 23)
  • GitHub Check: trufflehog
  • GitHub Check: mvn (windows-2022, 23)
  • GitHub Check: snippets
  • GitHub Check: ebnf

@h1alexbel

Copy link
Copy Markdown
Member Author

@yegor256 @maxonfjvipon addressed Rabbit comments

@h1alexbel

Copy link
Copy Markdown
Member Author

@maxonfjvipon reminder

yegor256
yegor256 previously approved these changes Jun 4, 2025
@yegor256
yegor256 enabled auto-merge June 4, 2025 19:52
@yegor256

yegor256 commented Jun 4, 2025

Copy link
Copy Markdown
Member

@h1alexbel what about Rabbit's suggestions? Some of them look reasonable.

auto-merge was automatically disabled June 5, 2025 06:41

Head branch was pushed to by a user without write access

@h1alexbel

Copy link
Copy Markdown
Member Author

@yegor256 applied, take a look again, please

@h1alexbel
h1alexbel requested a review from yegor256 June 5, 2025 10:46
@yegor256
yegor256 enabled auto-merge June 5, 2025 11:21
@yegor256

yegor256 commented Jun 5, 2025

Copy link
Copy Markdown
Member

@h1alexbel will be merged once all conversations are resolved above

@yegor256
yegor256 added this pull request to the merge queue Jun 5, 2025
Merged via the queue into objectionary:master with commit daef5e0 Jun 5, 2025
27 checks passed
@h1alexbel
h1alexbel deleted the 3480-pha branch June 5, 2025 11:28
@0crat

0crat commented Jun 6, 2025

Copy link
Copy Markdown

@yegor256 Hey there, code review superstar! 🌟 You've just racked up a sweet +24 points for your awesome review. Here's the breakdown: +12 for stepping up, +16 for tackling those 2102 hits-of-code (impressive!), and +6 for your 27 insightful comments. We had to trim 11 points to stay within the cap, but that's still a fantastic score! Your dedication to improving code quality is truly paying off. Keep up the great work! By the way, your current balance stands at -342. Let's keep that momentum going!

@0crat

0crat commented Jun 6, 2025

Copy link
Copy Markdown

@h1alexbel 🎉 Great contribution! You've earned +4 points for your hard work. While the code was a bit lengthy (2102 hits-of-code) and there were quite a few review comments (39), we appreciate your effort. Your current balance is +462. Keep up the good work and remember to focus on quality in your future submissions!

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.

4 participants