Skip to content

Files

Latest commit

 

History

History
31 lines (22 loc) · 954 Bytes

File metadata and controls

31 lines (22 loc) · 954 Bytes

Pattern: Use of null

Issue: -

Description

Scala discourages use of null, preferring Option.

Note, for performance sensitive code, prefer null over Option, in order to avoid virtual method calls and boxing. Label the nullable fields clearly with Nullable.

Parameters

NameDescriptionTypeDefault Value
allowNullChecks Allow null checks boolean true

Example configuration

<check enabled="true" class="org.scalastyle.scalariform.NullChecker" level="warning">
 <parameters>
  <parameter name="allowNullChecks">true</parameter>
 </parameters>
</check>