Skip to content

Ensure consistent snapshot-based iteration across ApplicationManager #446

Description

@sfloess

Part of #423: Race condition potential in ApplicationManager concurrent operations

Problem

Line 974 already uses snapshot-based iteration (copying the collection before iterating), but this pattern is not applied consistently across all methods that iterate over shared state. Inconsistent use means some iteration paths are still vulnerable to ConcurrentModificationException or missed/duplicate processing.

Location

  • platform-core/src/main/java/org/flossware/platform/core/ApplicationManager.java

Tasks

  • Audit all iteration points over the applications map and listener collections
  • Ensure every iteration uses a snapshot (defensive copy) before iterating
  • Verify that snapshots are taken while holding the appropriate lock
  • Add unit tests verifying iteration safety under concurrent modification

Acceptance Criteria

  • All iterations over shared collections use snapshot-based patterns
  • No ConcurrentModificationException possible during iteration
  • Snapshots are taken atomically under the correct lock

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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