/* ************************************************************** *
 *                                                                *
 * Copyright (c) 2005-2012, Kota Mizushima, All rights reserved.  *
 *                                                                *
 *                                                                *
 * This software is distributed under the modified BSD License.   *
 * ************************************************************** */
package onion.compiler

import scala.collection.mutable

/**
 * A type safe import list.
 * @author Kota Mizushima
 *
 */
class ImportList extends Iterable[ImportItem] {
  private var items = mutable.Buffer[ImportItem]()

  def add(item: ImportItem): Unit =  items += item
  def get(index: Int): ImportItem = items(index)
  def getItems: Array[ImportItem] = items.toArray
  override def size: Int = items.size
  def iterator: Iterator[ImportItem] = items.iterator
}
/* ************************************************************** *
 *                                                                *
 * Copyright (c) 2005-2012, Kota Mizushima, All rights reserved.  *
 *                                                                *
 *                                                                *
 * This software is distributed under the modified BSD License.   *
 * ************************************************************** */
package onion.compiler

import java.util.ArrayList
import java.util.Iterator
import java.lang.Iterable

/**
 * A type safe import list.
 * @author Kota Mizushima
 *
 */
class ImportList extends Iterable[ImportItem] {
  private var items = new ArrayList[ImportItem]

  def add(item: ImportItem): Unit =  items.add(item)
  def get(index: Int): ImportItem = items.get(index)
  def getItems: Array[ImportItem] = items.toArray(new Array[ImportItem](0)).asInstanceOf[Array[ImportItem]]
  def size: Int =  items.size
  def iterator: Iterator[ImportItem] = items.iterator
}
--- 
+++ 
@@ -7,9 +7,7 @@
  * ************************************************************** */
 package onion.compiler
 
-import java.util.ArrayList
-import java.util.Iterator
-import java.lang.Iterable
+import scala.collection.mutable
 
 /**
  * A type safe import list.
@@ -17,11 +15,11 @@
  *
  */
 class ImportList extends Iterable[ImportItem] {
-  private var items = new ArrayList[ImportItem]
+  private var items = mutable.Buffer[ImportItem]()
 
-  def add(item: ImportItem): Unit =  items.add(item)
-  def get(index: Int): ImportItem = items.get(index)
-  def getItems: Array[ImportItem] = items.toArray(new Array[ImportItem](0)).asInstanceOf[Array[ImportItem]]
-  def size: Int =  items.size
+  def add(item: ImportItem): Unit =  items += item
+  def get(index: Int): ImportItem = items(index)
+  def getItems: Array[ImportItem] = items.toArray
+  override def size: Int = items.size
   def iterator: Iterator[ImportItem] = items.iterator
 }
Use Scala's collection libraries instead of Java's them
