Skip to content

Fix stream-toarray-typed: align metadata with filter+copy pattern in both approaches#146

Merged
brunoborges merged 2 commits intomainfrom
copilot/fix-stream-toarray-typing
Mar 25, 2026
Merged

Fix stream-toarray-typed: align metadata with filter+copy pattern in both approaches#146
brunoborges merged 2 commits intomainfrom
copilot/fix-stream-toarray-typing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

The oldApproach label and descriptive text described only typed array conversion, while the actual old code demonstrates filtering and copying — making the metadata inconsistent with the code.

Changes

  • oldApproach label"Manual Array Copy""Manual Filter + Copy" across English source and all 12 locale translation files (ar, bn, de, es, fr, it, ja, ko, pl, pt-BR, tr, zh-CN)
  • summary — Updated to reflect the combined filter-then-collect-to-typed-array use case
  • explanation — Rewritten to explain that streams eliminate the intermediate ArrayList when chaining filter() into toArray(String[]::new)
  • whyModernWins / Concise entry — Now explicitly calls out the absence of an intermediate list: "No intermediate list — one expression replaces the manual loop and copy."

The code itself (for-loop with filter + toArray(new String[0]) vs stream().filter().toArray(String[]::new)) was already a fair comparison and is unchanged.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI linked an issue Mar 25, 2026 that may be closed by this pull request
…ilter+copy in both approaches

Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
Agent-Logs-Url: https://github.com/javaevolved/javaevolved.github.io/sessions/9eef2156-f7cf-4dac-8bb3-a3fb4be7c5e5
Copilot AI changed the title [WIP] Fix stream-toArray behavior for typed conversion Fix stream-toarray-typed: align metadata with filter+copy pattern in both approaches Mar 25, 2026
Copilot AI requested a review from brunoborges March 25, 2026 17:29
@brunoborges brunoborges marked this pull request as ready for review March 25, 2026 18:58
@brunoborges brunoborges merged commit eccbfec into main Mar 25, 2026
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.

[Code Issue] Typisiertes Stream-toArray

2 participants