Skip to content

Apply Intellij code cleanup suggestions - #144

Open
NolwennD wants to merge 1 commit into
eclipse-biscuit:mainfrom
NolwennD:intellij-suggestions
Open

NolwennD wants to merge 1 commit into
eclipse-biscuit:mainfrom
NolwennD:intellij-suggestions

Conversation

@NolwennD

Copy link
Copy Markdown

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().

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