Skip to content

fix: avoid sharing List values set across samples - #1349

Open
shin4141 wants to merge 1 commit into
naver:mainfrom
shin4141:codex/v35-fixture-monkey-list-isolation
Open

shin4141 wants to merge 1 commit into
naver:mainfrom
shin4141:codex/v35-fixture-monkey-list-isolation

Conversation

@shin4141

Copy link
Copy Markdown

Summary

  • Produce a fresh ArrayList for each sample when a List value reaches the set-decomposition fast path.
  • Preserve the existing container size and wildcard handling.
  • Add regression tests for sample independence and for a fixed-size input list producing a mutable sample.

Reproduction

On main d6e285af401f06a3934e2caddfdad052000276ce, both new tests fail: samples share the supplied list, and removing an item from a sample created from Arrays.asList throws UnsupportedOperationException. This addresses the List examples in #1348.

Tests

  • ./gradlew :fixture-monkey:test --tests com.navercorp.fixturemonkey.test.SetCollectionIsolationTest --no-daemon — 2/2 pass after the fix (2/2 failed before).
  • ./gradlew :fixture-monkey:test --no-daemon — 1,225/1,225 pass.

Scope

The change covers List values whose declared type accepts ArrayList. Other concrete List types and nested mutable elements are outside this patch.

@CLAassistant

CLAassistant commented Sep 30, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
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