Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExecutionContext dirty flag does not remain true when null is put for a non-existent key #4692

Open
GGHDMS opened this issue Oct 27, 2024 · 0 comments
Labels
status: waiting-for-triage Issues that we did not analyse yet type: bug

Comments

@GGHDMS
Copy link

GGHDMS commented Oct 27, 2024

Issue Description

Description:
There is an issue with the ExecutionContext class where the dirty flag does not stay true when a null value is passed for a key that does not exist in the context. This behavior leads to unexpected results, especially when the dirty flag is used to determine if any modifications have been made to the context.

Steps to Reproduce:

  1. Create a new ExecutionContext
  2. Add a new key-value pair using put, which sets the dirty flag to true
  3. Call put again with a different key and null value
  4. Observe that the dirty flag is incorrectly reset to false even though no change occurred

Example Code:

@Test
void testDirty() {
    ExecutionContext context = new ExecutionContext();
    context.put("1", "testString1");
    assertTrue(context.isDirty()); // Expected to be true
    context.put("2", null);
    assertTrue(context.isDirty()); // This fails, `dirty` flag is reset to false
}
@GGHDMS GGHDMS added status: waiting-for-triage Issues that we did not analyse yet type: bug labels Oct 27, 2024
@GGHDMS GGHDMS changed the title ExecutionContext dirty flag does not remain true when null is put for a non-existent key ExecutionContext dirty flag does not remain true when null is put for a non-existent key Oct 27, 2024
@GGHDMS GGHDMS changed the title ExecutionContext dirty flag does not remain true when null is put for a non-existent key ExecutionContext dirty flag does not remain true when null is put for a non-existent key Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage Issues that we did not analyse yet type: bug
Projects
None yet
Development

No branches or pull requests

1 participant