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
Trying to take a slice of a PagedSeq that starts on a page that hasn't been computed yet throws a NullPointerException. For example, the following works as expected:
But if we start one character later in the sequence (at the beginning of the second page), we get the following:
scala>PagedSeq.fromStrings(List.fill(5000)("a")).slice(4096, 4097)
java.lang.NullPointerException
at scala.collection.immutable.PagedSeq.slice(PagedSeq.scala:189)
at .<init>(<console>:9)
at .<clinit>(<console>)
...
The error does not occur if you force the second page to be computed (by calling toString or length, for example) before calling slice:
scala>vals=PagedSeq.fromStrings(List.fill(5000)("a"))
s: scala.collection.immutable.PagedSeq[Char] =PagedSeq(a, a, a, ...
scala> s.slice(4096, 4097)
res2: scala.collection.immutable.PagedSeq[Char] =PagedSeq(a)
The text was updated successfully, but these errors were encountered:
Trying to take a slice of a PagedSeq that starts on a page that hasn't been computed yet throws a NullPointerException. For example, the following works as expected:
But if we start one character later in the sequence (at the beginning of the second page), we get the following:
The error does not occur if you force the second page to be computed (by calling toString or length, for example) before calling slice:
The text was updated successfully, but these errors were encountered: