Merge pull request #397 from lbergelson/lb_scala_2.10.2
Update scala from 2.9 to 2.10.2
This commit is contained in:
commit
a29f1f84bf
|
|
@ -526,6 +526,7 @@
|
|||
<fileset dir="${lib.dir}">
|
||||
<include name="scala-compiler-*.jar"/>
|
||||
<include name="scala-library-*.jar"/>
|
||||
<include name="scala-reflect-*.jar"/>
|
||||
</fileset>
|
||||
</path>
|
||||
<taskdef resource="scala/tools/ant/antlib.xml">
|
||||
|
|
@ -537,7 +538,7 @@
|
|||
<target name="scala.compile" depends="init,resolve,gatk.compile,queue-extensions.generate,init.scala.compile" if="include.scala">
|
||||
<mkdir dir="${scala.classes}"/>
|
||||
<echo>Building Scala...</echo>
|
||||
<scalac fork="true" jvmargs="-Xmx512m" destdir="${scala.classes}" classpathref="scala.dependencies" deprecation="yes" unchecked="yes">
|
||||
<scalac fork="true" jvmargs="-Xmx512m" destdir="${scala.classes}" classpathref="scala.dependencies" deprecation="yes" unchecked="yes" addparams="-feature">
|
||||
<src refid="scala.source.path" />
|
||||
<src path="${queue-extensions.source.dir}" />
|
||||
<include name="**/*.scala" />
|
||||
|
|
@ -1218,7 +1219,7 @@
|
|||
|
||||
<target name="test.scala.compile" depends="test.java.compile,scala.compile" if="include.scala">
|
||||
<echo message="Scala: Compiling test cases!"/>
|
||||
<scalac fork="true" jvmargs="-Xmx512m" destdir="${scala.test.classes}" deprecation="yes" unchecked="yes">
|
||||
<scalac fork="true" jvmargs="-Xmx512m" destdir="${scala.test.classes}" deprecation="yes" unchecked="yes" addparams="-feature">
|
||||
<src refid="scala.test.source.path" />
|
||||
<classpath>
|
||||
<path refid="build.results"/>
|
||||
|
|
|
|||
4
ivy.xml
4
ivy.xml
|
|
@ -82,8 +82,8 @@
|
|||
<dependency org="net.sf.gridscheduler" name="drmaa" rev="latest.integration"/>
|
||||
|
||||
<!-- Scala dependancies -->
|
||||
<dependency org="org.scala-lang" name="scala-compiler" rev="2.9.2"/>
|
||||
<dependency org="org.scala-lang" name="scala-library" rev="2.9.2"/>
|
||||
<dependency org="org.scala-lang" name="scala-compiler" rev="2.10.2"/>
|
||||
<dependency org="org.scala-lang" name="scala-library" rev="2.10.2"/>
|
||||
|
||||
<!-- testing and evaluation dependencies -->
|
||||
<dependency org="org.testng" name="testng" rev="6.8"/>
|
||||
|
|
|
|||
|
|
@ -33,10 +33,9 @@ import java.io.File
|
|||
import scala.tools.nsc.reporters.AbstractReporter
|
||||
import java.lang.String
|
||||
import org.apache.log4j.Level
|
||||
import scala.tools.nsc.util.{FakePos, NoPosition, Position}
|
||||
import org.broadinstitute.sting.queue.util.TextFormatUtils._
|
||||
import org.broadinstitute.sting.utils.classloader.JVMUtils
|
||||
import tools.util.StringOps
|
||||
import scala.reflect.internal.util.{FakePos, NoPosition, Position, StringOps}
|
||||
|
||||
/**
|
||||
* Plugin manager for QScripts which loads QScripts into the current class loader.
|
||||
|
|
@ -53,7 +52,10 @@ class QScriptManager() extends Logging {
|
|||
settings.outdir.value = tempDir.getPath
|
||||
|
||||
// Set the classpath to the current class path.
|
||||
JVMUtils.getClasspathURLs.foreach(url => settings.classpath.append(url.getPath))
|
||||
JVMUtils.getClasspathURLs.foreach(url => {
|
||||
settings.bootclasspath.append(url.getPath)
|
||||
settings.classpath.append(url.getPath)
|
||||
})
|
||||
|
||||
val reporter = new QScriptManager.Log4JReporter(settings)
|
||||
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class DrmaaJobRunner(val session: Session, val function: CommandLineFunction) ex
|
|||
// resource of the designated queue to SIGTERM
|
||||
session.control(jobId, Session.TERMINATE)
|
||||
} catch {
|
||||
case e =>
|
||||
case e: Exception =>
|
||||
logger.error("Unable to kill job " + jobId, e)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ object Lsf706JobRunner extends Logging {
|
|||
if (LibBat.lsb_signaljob(runner.jobId, SIGTERM) < 0)
|
||||
logger.error(LibBat.lsb_sperror("Unable to kill job " + runner.jobId))
|
||||
} catch {
|
||||
case e =>
|
||||
case e: Exception=>
|
||||
logger.error("Unable to kill job " + runner.jobId, e)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ class ShellJobRunner(val function: CommandLineFunction) extends CommandLineJobRu
|
|||
try {
|
||||
controller.tryDestroy()
|
||||
} catch {
|
||||
case e =>
|
||||
logger.error("Unable to kill shell job: " + function.description)
|
||||
case e: Exception =>
|
||||
logger.error("Unable to kill shell job: " + function.description, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import org.broadinstitute.sting.queue.{QException, QSettings}
|
|||
import java.lang.IllegalStateException
|
||||
import org.broadinstitute.sting.queue.util._
|
||||
import org.broadinstitute.sting.utils.io.IOUtils
|
||||
import scala.language.reflectiveCalls
|
||||
|
||||
/**
|
||||
* The base interface for all functions in Queue.
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class VCFExtractSamples(inVCF: File, outVCF: File, samples: List[String]) extend
|
|||
@Argument(doc="The samples to extract from the VCF") var extractSamples : List[String] = samples
|
||||
|
||||
var out : PrintWriter = _
|
||||
var columns : List[Int] = 0 to 8 toList
|
||||
var columns : List[Int] = (0 to 8).toList
|
||||
|
||||
def run = {
|
||||
out = new PrintWriter(new PrintStream(outputVCF))
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
package org.broadinstitute.sting.queue.util
|
||||
|
||||
import org.apache.commons.mail.{MultiPartEmail, EmailAttachment}
|
||||
import java.io.{FileReader, File}
|
||||
import java.io.{IOException, FileReader, File}
|
||||
import javax.mail.internet.InternetAddress
|
||||
import scala.collection.JavaConversions._
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ class EmailMessage extends Logging {
|
|||
try {
|
||||
Retry.attempt(() => send(settings), .5)
|
||||
} catch {
|
||||
case e => logger.error("Error sending message: %n%s".format(this.toString), e)
|
||||
case e: RetryException=> logger.error("Error sending message: %n%s".format(this.toString), e)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
package org.broadinstitute.sting.queue.util
|
||||
|
||||
import scala.language.implicitConversions
|
||||
|
||||
/**
|
||||
* An importable object that provides automatic primitive to option conversion.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ object Retry extends Logging {
|
|||
result = f()
|
||||
success = true
|
||||
} catch {
|
||||
case e => {
|
||||
case e: Exception=> {
|
||||
count += 1
|
||||
if (count < tries) {
|
||||
val minutes = wait(count-1)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
package org.broadinstitute.sting.queue.util
|
||||
|
||||
import java.io.{Serializable, File}
|
||||
import scala.language.implicitConversions
|
||||
|
||||
/**
|
||||
* Converts String to/from File
|
||||
|
|
@ -77,21 +78,6 @@ object StringFileConversions {
|
|||
})
|
||||
}
|
||||
|
||||
implicit def stringsAsFiles(x: Set[Comparable[_ >: File with String <: Comparable[_ >: File with String <: Comparable[_ >: File with String <: Serializable] with Serializable] with Serializable] with Serializable]): Set[File] = {
|
||||
x.map(_ match {
|
||||
case string: String => stringAsFile(string)
|
||||
case file: File => file
|
||||
case null => null
|
||||
})
|
||||
}
|
||||
|
||||
implicit def filesAsStrings(x: Set[Comparable[_ >: String with File <: Comparable[_ >: String with File <: Comparable[_ >: String with File <: Serializable] with Serializable] with Serializable] with Serializable]): Set[String] = {
|
||||
x.map(_ match {
|
||||
case file: File => fileAsString(file)
|
||||
case string: String => string
|
||||
case null => null
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -124,11 +110,4 @@ trait StringFileConversions {
|
|||
StringFileConversions.filesAsStringsList(x)
|
||||
}
|
||||
|
||||
implicit def stringsAsFiles(x: Set[Comparable[_ >: File with String <: Comparable[_ >: File with String <: Comparable[_ >: File with String <: Serializable] with Serializable] with Serializable] with Serializable]): Set[File] = {
|
||||
StringFileConversions.stringsAsFiles(x)
|
||||
}
|
||||
|
||||
implicit def filesAsStrings(x: Set[Comparable[_ >: String with File <: Comparable[_ >: String with File <: Comparable[_ >: String with File <: Serializable] with Serializable] with Serializable] with Serializable]): Set[String] = {
|
||||
StringFileConversions.filesAsStrings(x)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ object PipelineTest extends BaseTest with Logging {
|
|||
println("Executing test %s with Queue arguments: %s".format(name, Utils.join(" ",command)))
|
||||
CommandLineProgram.start(instance, command)
|
||||
} catch {
|
||||
case e =>
|
||||
case e: Exception =>
|
||||
gotAnException = true
|
||||
if (expectedException != null) {
|
||||
// we expect an exception
|
||||
|
|
@ -224,7 +224,7 @@ object PipelineTest extends BaseTest with Logging {
|
|||
try {
|
||||
commandLine.shutdown()
|
||||
} catch {
|
||||
case _ => /* ignore */
|
||||
case _: Throwable => /* ignore */
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -87,44 +87,6 @@ class StringFileConversionsUnitTest {
|
|||
Assert.assertEquals(strings, Seq(null, null))
|
||||
}
|
||||
|
||||
@Test
|
||||
def testStringToFileSet() {
|
||||
var files = Set(new File("foo"))
|
||||
files += "bar"
|
||||
Assert.assertEquals(files, Set(new File("foo"), new File("bar")))
|
||||
|
||||
files = Set(new File("foo"))
|
||||
files += null.asInstanceOf[String]
|
||||
Assert.assertEquals(files, Set(new File("foo"), null))
|
||||
|
||||
files = Set[File](null)
|
||||
files += "foo"
|
||||
Assert.assertEquals(files, Set(new File("foo"), null))
|
||||
|
||||
files = Set[File](null)
|
||||
files += null.asInstanceOf[String]
|
||||
Assert.assertEquals(files, Set(null))
|
||||
}
|
||||
|
||||
@Test
|
||||
def testFileToStringSet() {
|
||||
var strings = Set("foo")
|
||||
strings += new File("bar")
|
||||
Assert.assertEquals(strings, Set("foo", "bar"))
|
||||
|
||||
strings = Set("foo")
|
||||
strings += null.asInstanceOf[File]
|
||||
Assert.assertEquals(strings, Set("foo", null))
|
||||
|
||||
strings = Set[String](null)
|
||||
strings += new File("foo")
|
||||
Assert.assertEquals(strings, Set("foo", null))
|
||||
|
||||
strings = Set[String](null)
|
||||
strings += null.asInstanceOf[File]
|
||||
Assert.assertEquals(strings, Set(null))
|
||||
}
|
||||
|
||||
@Test
|
||||
def testStringListToFileList() {
|
||||
var files = Seq(new File("foo"))
|
||||
|
|
@ -163,41 +125,4 @@ class StringFileConversionsUnitTest {
|
|||
Assert.assertEquals(strings, Seq(null, null))
|
||||
}
|
||||
|
||||
@Test
|
||||
def testStringSetToFileSet() {
|
||||
var files = Set(new File("foo"))
|
||||
files ++= Set("bar")
|
||||
Assert.assertEquals(files, Set(new File("foo"), new File("bar")))
|
||||
|
||||
files = Set(new File("foo"))
|
||||
files ++= Set[String](null)
|
||||
Assert.assertEquals(files, Set(new File("foo"), null))
|
||||
|
||||
files = Set[File](null)
|
||||
files ++= Set("foo")
|
||||
Assert.assertEquals(files, Set(new File("foo"), null))
|
||||
|
||||
files = Set[File](null)
|
||||
files ++= Set[String](null)
|
||||
Assert.assertEquals(files, Set(null))
|
||||
}
|
||||
|
||||
@Test
|
||||
def testFileSetToStringSet() {
|
||||
var strings = Set("foo")
|
||||
strings ++= Set(new File("bar"))
|
||||
Assert.assertEquals(strings, Set("foo", "bar"))
|
||||
|
||||
strings = Set("foo")
|
||||
strings ++= Set[File](null)
|
||||
Assert.assertEquals(strings, Set("foo", null))
|
||||
|
||||
strings = Set[String](null)
|
||||
strings ++= Set(new File("foo"))
|
||||
Assert.assertEquals(strings, Set("foo", null))
|
||||
|
||||
strings = Set[String](null)
|
||||
strings ++= Set[File](null)
|
||||
Assert.assertEquals(strings, Set(null))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue