You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an example, the FlightOfferSearch class has an array representing Stops within a Segment. If there are no stops, the array is NULL and can cause an NPE when using java streams.
Its best practice to either return an Optional or return an empty collection to guard against NPE's.
Steps to Reproduce
Make a call to Amadeus Shopping flightOffersSearch API using any available test env data
Examine the returned FlightOfferSearch object. Collections, such as Stops, with no data, are returned with NULL assignment
Expected Behavior: Collections with no data should be empty, not NULL
Actual Behavior: Collections such as Stops have a NULL assignment, causing NPE when streaming is applied.
Stable Behavior? 100%
The text was updated successfully, but these errors were encountered:
in coming months, we are going to do some changes to mitigate some Code Smells reported by Sonar.
One of them is your advice about returning a list or not return nulls.
Description
As an example, the FlightOfferSearch class has an array representing Stops within a Segment. If there are no stops, the array is NULL and can cause an NPE when using java streams.
Its best practice to either return an Optional or return an empty collection to guard against NPE's.
Steps to Reproduce
Expected Behavior: Collections with no data should be empty, not NULL
Actual Behavior: Collections such as Stops have a NULL assignment, causing NPE when streaming is applied.
Stable Behavior? 100%
The text was updated successfully, but these errors were encountered: