Skip to content

Bug: RequirementService.getRelations() mutates JPA result list #321

@Brad-Edwards

Description

@Brad-Edwards

Description

RequirementService.getRelations() calls outgoing.addAll(incoming) which mutates the list returned by findBySourceIdWithEntities(). If the JPA implementation returns an unmodifiable list (which some do), this throws UnsupportedOperationException. Even when it works, mutating JPA-managed collections is fragile.

Expected behavior: Create a new ArrayList and combine both lists into it, rather than mutating the outgoing list in place.

Location: RequirementService.java, getRelations() method

Traced Requirements

  • GC-A003: Typed DAG Relations

Impact

Reliability — potential runtime exception depending on JPA provider behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions