相关疑难解决方法(0)

Scala避免使用null

我在github上有一个通过编码进行分析的项目.分析建议对以下代码行使用"避免使用null":

def doSomethingWithPath(path:Path) = {
    require(path != null, "Path should not be null") //<-to avoid
    ...
}
Run Code Online (Sandbox Code Playgroud)

什么是最简单的scala惯用法来修复它?

scala idiomatic preconditions codacy

7
推荐指数
2
解决办法
1354
查看次数

标签 统计

codacy ×1

idiomatic ×1

preconditions ×1

scala ×1