scapegoat-scala/sbt-scapegoat

False positive null parameter using default namespace in Scala XML

Closed this issue · 1 comments

XML like
<DeclareSalary xmlns="http://www.swissdec.ch/schema/sd/20051002/SalaryDeclarationServiceTypes" xmlns:sd="http://www.swissdec.ch/schema/sd/20051002/SalaryDeclaration"

causes the following warning/error:

Null is used as a method parameter: new scala.xml.NamespaceBinding(null, "http://www.swissdec.ch/schema/sd/20051002/SalaryDeclarationServiceTypes", $tmpscope)

Reason is that a default namespace is in fact using a null parameter:
https://github.com/scala/scala-xml/blob/master/src/main/scala/scala/xml/NamespaceBinding.scala

Thus one might argue that is actually not a false positive because the parameter null is actually used, but from an end-user perspective there is no workaround, that is just how the Scala API is.

Sorry, wrong project