8000 Replace custom linked list with a queue and refcount by andrewaylett · Pull Request #97 · andrewaylett/arc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace custom linked list with a queue and refcount #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already 8000 on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

andrewaylett
Copy link
Owner

No description provided.

@Copilot Copilot AI review requested due to automatic review settings May 28, 2025 20:28
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR replaces the custom linked list implementation with a queue-based solution that includes reference counting, simplifying element management. Key changes include:

  • Converting linked list operations in ElementList to use a Deque for queuing elements.
  • Removing the TailElement, HeadElement, and ElementBase classes.
  • Updating element ownership handling and reference counting in Element and InnerArc.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/src/test/java/eu/aylett/arc/ArcTest.java Updated semaphore synchronization in the concurrent test.
lib/src/main/java/eu/aylett/arc/internal/TailElement.java Removed obsolete linked list tail implementation.
lib/src/main/java/eu/aylett/arc/internal/InnerArc.java Updated owner retrieval and switch-expression logic.
lib/src/main/java/eu/aylett/arc/internal/HeadElement.java Removed obsolete linked list head implementation.
lib/src/main/java/eu/aylett/arc/internal/ElementList.java Replaced linked list operations with a queue and introduced refcount-based methods.
lib/src/main/java/eu/aylett/arc/internal/ElementBase.java Removed obsolete interface.
lib/src/main/java/eu/aylett/arc/internal/Element.java Updated to manage element ownership and reference counting.
config/checkstyle/checkstyle.xml Removed the Indentation module and related suppression settings.
Comments suppressed due to low confidence (2)

lib/src/test/java/eu/aylett/arc/ArcTest.java:186

  • Changing from inOneSem.release() to inOneSem.acquire() could block the test unexpectedly. Please confirm that this alteration is intentional and that the test is updated accordingly.
inOneSem.acquire();

lib/src/main/java/eu/aylett/arc/internal/ElementList.java:133

  • The method bringToHead() receives the parameter 'element', yet it uses 'newElement' when calling addRef(). This appears to be an incorrect variable reference and should be corrected to use 'element'.
var newlyAdded = newElement.addRef(this);

Copy link
  • Surviving mutants in this change: 15
  • Killed mutants in this change: 45
class surviving killed
🧟eu.aylett.arc.internal.Element 7 18
🧟eu.aylett.arc.internal.ElementList 7 17
🧟eu.aylett.arc.internal.InnerArc 1 10

See https://pitest.org

@andrewaylett andrewaylett merged commit 7d8bc40 into main May 28, 2025
6 checks passed
@andrewaylett andrewaylett deleted the push-vlonplsqotyp branch May 28, 2025 20:31
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.

1 participant
0