googleads / googleads/googleads-java-lib
Queries with no results return a null array
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 234
- Forks
- 360
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
This library allows you to query via StatementBuilder. When you run a query that returns no results, the XYPage#getResults() returns null. On my side, this has only been confirmed to be true with InventoryServiceInterface#getAdUnitsByStatement(), however it would be right to assume it is true for other query implementations as well.
Returning null arrays is an anti-pattern. Can this be fixed to return empty arrays instead? This has already been mentioned in #214.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with StatementBuilder and the InventoryServiceInterface#getAdUnitsByStatement() path, then review the related discussion in #214. Check how XYPage#getResults() is produced for empty query results across the other query implementations. Done means empty arrays are returned instead of null for every affected implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100