-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
I don't know whether the follow issue reflects a suboptimal detail in the scala-xml
API or whether my IDE is raising a spurious warning, and I'm inquiring here in case it's the former. Here are the details:
The Elem()
constructor expects a string, representing a namespace prefix, as its first argument. An empty string throws an error:
IllegalArgumentException: prefix of zero length, use null instead
Using null
works, but IntelliJ raises a warning:
Using Option is a safer alternative to null
I can suppress the warning in the IDE, but should I have to? That is, is there a reason that the prefix argument is String
(with an implementation that does not accept an empty string) instead of Option[String]
? Or is IntelliJ being incorrectly alarmist in a situation where the use of null
is, in fact, properly idiomatic in Scala 3?
Metadata
Metadata
Assignees
Labels
No labels