[JAVA-4313] Observable head should not return null Created: 26/Sep/21 Updated: 27/Oct/23 Resolved: 28/Sep/21 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Scala |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Scott Rice | Assignee: | Ross Lawley |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | external-user | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
null shouldn't be returned by a Scala library. None should be returned instead. So, Observable.head could be changed to this:
|
| Comments |
| Comment by Ross Lawley [ 28/Sep/21 ] |
|
Unfortunately, null is unavoidable here. |
| Comment by Scott Rice [ 26/Sep/21 ] |
|
On second thought, None is not a valid value of most types of T. So, my proposed solution isn't a good one. Using null here may be unavoidable. |