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.