Skip to content

test(core): define explicit-null shadowing behavior in ChangeSetStack #22

Description

@philipgreat

Background

ChangeSetStack.get() currently treats a returned null as if a field were absent and continues searching lower scopes. That makes it impossible to distinguish an explicit update-to-null from no update in the current scope.

Scope

Add a regression test that defines the required behavior for explicit null values in nested scopes, and make the smallest production correction needed for the test to pass.

Test cases

  • A lower scope stores a non-null field value.
  • A higher scope explicitly stores null for the same entity and field.
  • Reading while the higher scope is active returns null, not the lower value.
  • Popping the higher scope restores the lower value.
  • An entirely absent field still returns null.

Acceptance criteria

  • Presence and value are distinguished internally without changing the public API unnecessarily.
  • Existing non-null stack-precedence behavior remains unchanged.
  • A regression test fails against the current implementation and passes with the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjavaPull requests that update java code

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions