There are many null checks for arguments in the codebase, e.g.
override def write(dataFrame: DataFrame, streamManager: StreamManager): StreamingQuery = {
if (dataFrame == null) {
throw new IllegalArgumentException("Null DataFrame.")
}
Since null should not be used in scala, an occurrence of null is a serious problem which cannot be handled. Throwing an IllegalArgumentException instead of letting the program fail with a NullPointerException adds little information.
Task
- Remove
null checks
- Wrap
null values coming from Java code in Option
There are many null checks for arguments in the codebase, e.g.
Since
nullshould not be used in scala, an occurrence ofnullis a serious problem which cannot be handled. Throwing anIllegalArgumentExceptioninstead of letting the program fail with aNullPointerExceptionadds little information.Task
nullchecksnullvalues coming from Java code inOption