Skip to content

Code style and Java language level adoptions - #982

Merged
snazy merged 1 commit into
projectnessie:mainfrom
snazy:code-style-stuff
Sep 21, 2026
Merged

snazy merged 1 commit into
projectnessie:mainfrom
snazy:code-style-stuff

Conversation

@snazy

@snazy snazy commented Sep 17, 2026

Copy link
Copy Markdown
Member
  • Replace Arrays.asList() with single element with List.of()
  • enhanced switch expression
  • pattern variable
  • Use String.repeat()
  • Use .isEmpty()
  • Remove unused ParseError
  • Remove unused function in TypeErrors
  • Remove duplicate if

* Replace `Arrays.asList()` with single element with `List.of()`
* enhanced switch expression
* pattern variable
* Use String.repeat()
* Use `.isEmpty()`
* Remove unused `ParseError`
* Remove unused function in TypeErrors
* Remove duplicate `if`
@snazy
snazy requested a review from XN137 September 17, 2026 14:44
for (int i = 0; i < location.column(); i++) {
result.append(dot);
}
result.append(String.valueOf(dot).repeat(Math.max(0, location.column())));

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.

are these kind of changes really an improvement in terms of readability/performance?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤷


import org.projectnessie.cel.common.Location;

public final class ParseError extends RuntimeException {

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.

does this break backward-compatibility of our public api?
if yes maybe need to document this in the release notes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nah, not breaking. This ParseError type wasn't used at all.

@snazy
snazy merged commit 83f027f into projectnessie:main Sep 21, 2026
3 checks passed
@snazy
snazy deleted the code-style-stuff branch September 21, 2026 06:46
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.

2 participants