Write this as 

needsTransform = Array.tabulate[Boolean](objectInspectors.length) { i =>
  objectInspectors(i) != outputOI
}