You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a null value is cast as a Java collection, and an implicit converter from scala.collection.convert.WrapAsScala is in scope, the converter will be passed null and return a wrapped collection with null as the underlying collection. Calling any bridge method provided by the wrapper will result in a NullPointerException. This can cause unexpected behavior in an application that relies on interacting with a wrapper collection, but does not have access to the underlying java reference in order to determine whether it is a collection or null. In this scenario, the application gets the collection wrapper via whatever means, and tries to operate upon it - thus generating a somewhat counter-intuitive exception.
When a null value is cast as a Java collection, and an implicit converter from
scala.collection.convert.WrapAsScala
is in scope, the converter will be passed null and return a wrapped collection with null as the underlying collection. Calling any bridge method provided by the wrapper will result in aNullPointerException
. This can cause unexpected behavior in an application that relies on interacting with a wrapper collection, but does not have access to the underlying java reference in order to determine whether it is a collection or null. In this scenario, the application gets the collection wrapper via whatever means, and tries to operate upon it - thus generating a somewhat counter-intuitive exception.An example of this issue in the wild can be seen at scalafx issue #178, and an example of code that generates such a wrapper before the issue was fixed.
The text was updated successfully, but these errors were encountered: