@@ -26,42 +26,6 @@ object Arrays {
2626
2727 /** Create an array of a reference type T.
2828 */
29- def newRefArray [T ](componentType : Class [T ])(length : Int ): Array [T ] =
30- jlr.Array .newInstance(componentType, length).asInstanceOf [Array [T ]]
31-
32- /** Create a Byte[] array */
33- def newByteArray (length : Int ): Array [Byte ] =
34- jlr.Array .newInstance(classOf [Byte ], length).asInstanceOf [Array [Byte ]]
35-
36- /** Create a Short[] array */
37- def newShortArray (length : Int ): Array [Short ] =
38- jlr.Array .newInstance(classOf [Short ], length).asInstanceOf [Array [Short ]]
39-
40- /** Create a Char[] array */
41- def newCharArray (length : Int ): Array [Char ] =
42- jlr.Array .newInstance(classOf [Char ], length).asInstanceOf [Array [Char ]]
43-
44- /** Create an Int[] array */
45- def newIntArray (length : Int ): Array [Int ] =
46- jlr.Array .newInstance(classOf [Int ], length).asInstanceOf [Array [Int ]]
47-
48- /** Create a Long[] array */
49- def newLongArray (length : Int ): Array [Long ] =
50- jlr.Array .newInstance(classOf [Long ], length).asInstanceOf [Array [Long ]]
51-
52- /** Create a Float[] array */
53- def newFloatArray (length : Int ): Array [Float ] =
54- jlr.Array .newInstance(classOf [Float ], length).asInstanceOf [Array [Float ]]
55-
56- /** Create a Double[] array */
57- def newDoubleArray (length : Int ): Array [Double ] =
58- jlr.Array .newInstance(classOf [Double ], length).asInstanceOf [Array [Double ]]
59-
60- /** Create a Boolean[] array */
61- def newBooleanArray (length : Int ): Array [Boolean ] =
62- jlr.Array .newInstance(classOf [Boolean ], length).asInstanceOf [Array [Boolean ]]
63-
64- /** Create a scala.runtime.BoxedUnit[] array */
65- def newUnitArray (length : Int ): Array [Unit ] =
66- jlr.Array .newInstance(classOf [scala.runtime.BoxedUnit ], length).asInstanceOf [Array [Unit ]]
29+ def newArray [Arr ](componentType : Class [_], returnType : Class [Arr ], dimensions : Array [Int ]): Arr =
30+ jlr.Array .newInstance(componentType, dimensions : _* ).asInstanceOf [Arr ]
6731}
0 commit comments