Skip to content

Apply Intellij code cleanup suggestions - #144

Merged
divarvel merged 1 commit into
eclipse-biscuit:mainfrom
NolwennD:intellij-suggestions
Oct 26, 2026
Merged

divarvel merged 1 commit into
eclipse-biscuit:mainfrom
NolwennD:intellij-suggestions

Conversation

@NolwennD

Copy link
Copy Markdown
Contributor

Hello,

I apply Intellij code cleanup suggestion without behavior modifications.

Most of modifications are:

  • Use the diamond operator (<>) instead of explicit generic type arguments.
  • Replace lambdas with method references (e.g. this::formatTerm, Optional::isPresent, Stream::of).
  • Replace indexed for loops with enhanced for loops where the index was only used for get(i).
  • Make fields final where they are never reassigned.
  • Pass the source collection to the copy constructor (new ArrayList<>(other)) instead of looping or calling addAll.
  • Use Optional idioms: isEmpty() instead of !isPresent(), ifPresent(...) instead of if (isPresent()) { get() }, and Optional.stream().

@divarvel

Copy link
Copy Markdown
Contributor

@Korbik @Geal any thoughts on this? Diamond operators should be fine since we already use the stream API and optionals in some places

@Korbik Korbik 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.

LGTM

@divarvel
divarvel merged commit bb46c13 into eclipse-biscuit:main Oct 26, 2026
2 checks passed
NolwennD added a commit to NolwennD/biscuit-java that referenced this pull request Oct 26, 2026
WorldTest failing to compile because of a missing java.util.Arrays.

Replace Arrays.asList with List.of in WorldTest, consistent with the
rest of the file.
divarvel added a commit that referenced this pull request Oct 27, 2026
fix: restore build after merging #144 due to missing import
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.

3 participants