Skip to content

chore: more java 21 idiomatic code #2143

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 on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

robfrank
Copy link
Collaborator

@robfrank robfrank commented Apr 8, 2025

What does this PR do?

A brief description of the change being made with this pull request.

Motivation

What inspired you to submit this pull request?

Related issues

A list of issues either fixed, containing architectural discussions, otherwise relevant
for this Pull Request.

Additional Notes

Anything else we should know when reviewing?

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

Copy link

codacy-production bot commented Apr 8, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 17fe4021 33.09%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (17fe402) Report Missing Report Missing Report Missing
Head commit (433252c) 69888 44865 64.20%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2143) 1224 405 33.09%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@robfrank robfrank force-pushed the improvement/0000-chore-java-21 branch 3 times, most recently from cb196b1 to 31ed06e Compare April 11, 2025 10:08
@robfrank robfrank force-pushed the improvement/0000-chore-java-21 branch from 31ed06e to 433252c Compare April 14, 2025 08:37
@robfrank robfrank requested a review from Copilot April 14, 2025 08:37
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.

Copilot reviewed 134 out of 134 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (5)

engine/src/main/java/com/arcadedb/index/TypeIndex.java:499

  • Ensure that 'indexesOnBuckets' is of a type that supports getFirst() (e.g. LinkedList) as replacing get(0) may cause incompatibility if it remains an ArrayList.
return indexesOnBuckets.getFirst();

engine/src/main/java/com/arcadedb/engine/PageManagerFlushThread.java:52

  • Ensure that the 'pages' list is of a type that supports getFirst(); otherwise, consider using pages.get(0) if pages is an ArrayList.
this.database = pages == null || pages.isEmpty() ? null : pages.getFirst().pageId.getDatabase();

engine/src/main/java/com/arcadedb/engine/LocalBucket.java:1719

  • Verify that 'orderedRecordContentInPage' supports getLast(); if it is an ArrayList, this call will not compile. Consider using get(orderedRecordContentInPage.size()-1) if necessary.
final int[] lastRecord = orderedRecordContentInPage.getLast();

engine/src/main/java/com/arcadedb/database/TransactionContext.java:194

  • Confirm that the 'transactions' list supports removeLast(); if it is an ArrayList, this will fail at runtime. Consider using an appropriate collection type (e.g. Deque or LinkedList).
return transactions.removeLast();

console/src/test/java/com/arcadedb/console/TerminalParser.java:91

  • Verify that the 'words' collection’s implementation supports getLast(); if it is an ArrayList, use get(words.size() - 1).
wordCursor = words.getLast().length();

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