Skip to content
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

Suggest replacing list.get(0) with list.getFirst() and list.get(list.size() - 1) with list.getLast() #541

Open
Luro02 opened this issue Jun 1, 2024 · 1 comment
Labels
api lints that check for code that reimplements parts of the api D-easy Easy to implement. enhancement New feature or request java-21 low-priority new-lint A new lint.

Comments

@Luro02
Copy link
Collaborator

Luro02 commented Jun 1, 2024

What it does

The methods are there for a reason, so might as well suggest using them.

Lint Name

No response

Category

api

Example

<code>

Could be written as:

<code>
@Luro02 Luro02 added enhancement New feature or request D-easy Easy to implement. new-lint A new lint. api lints that check for code that reimplements parts of the api low-priority labels Jun 1, 2024
@Luro02
Copy link
Collaborator Author

Luro02 commented Jul 1, 2024

Note this doesn't exist in Java 17, only in Java 21

@Luro02 Luro02 added the java-21 label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api lints that check for code that reimplements parts of the api D-easy Easy to implement. enhancement New feature or request java-21 low-priority new-lint A new lint.
Projects
None yet
Development

No branches or pull requests

1 participant