[TRNSPRTPCE-103] mappingServices takes 2 parameters but maps only one Created: 18/Apr/19  Updated: 13/Sep/21

Status: Open
Project: transportpce
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Low
Reporter: Rami Mohamed Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Code cleaning

 Description   

mappingServices method in ModelMappingUtils class takes two arguments serviceCreateInput and serviceReconfigureInput but maps only one depending on which is null

if (serviceCreateInput != null) {} else if (serviceReconfigureInput != null) {}

This isn't a good method signature as it's not clear about functionality 



 Comments   
Comment by Olivier Renais [ 30/Apr/19 ]

I don't really see that as an issue. This method will be called following an RPC. The RPC can be either a service create or a service reconfigure. So we will never have the 2 related attributes (input) valid at the same time. Each RPC will trig different behaviour.

Comment by Rami Mohamed [ 15/May/19 ]

orenais

The signature of the method could lead to wrong assumptions, the first thing would come to mind is it maps 2 objects to the output, while it actually maps only one to the output and it's not clear why the first argument shadows the second 

Generated at Wed Feb 07 20:42:16 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.