Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Misc Library
    • Labels:
      None
    • Environment:

      ArrayBuffer padTo length

      Description

      scala> import scala.collection.mutable._
      
      scala> var a = ArrayBuffer(0,0,0)
      a: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer(0, 0, 0)
      
      scala> a.padTo(5, 0)
      res56: scala.collection.mutable.ArrayBuffer[Int] = ArrayBuffer(0, 0, 0, 0, 0)
      
      scala> a.length
      res57: Int = 3 /// EXPECTED: 5
      
      scala> a(4)
      java.lang.IndexOutOfBoundsException: 4
              at scala.collection.mutable.ResizableArray$$class.apply(ResizableArray.scala:42)
              at scala.collection.mutable.ArrayBuffer.apply(ArrayBuffer.scala:26)
              at .<init>(<console>:9)
              at .<clinit>(<console>)
              at RequestResult$$.<init>(<console>:4)
              at RequestResult$$.<clinit>(<console>)
              at RequestResult$$result(<console>)
              at sun.reflect.NativeMethodAccess...
      /// EXPECTED: should work
      

        Activity

        Hide
        Paul Phillips added a comment -

        "Returns a new sequence ..."

        Show
        Paul Phillips added a comment - "Returns a new sequence ..."

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexey Tarasevich
            TracCC:
            Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development