Resolving warnings
--specifying exception types in cases where none was already specified ----mostly changed to catch Exception instead of Throwable ----EmailMessage has a point where it should only be expecting a RetryException but was catching everything --changing build.xml so that it prints scala feature warning details --added necessary imports needed to remove feature warnings --updating a newly deprecated enum declaration to match the new syntax
This commit is contained in:
parent
b32ad99d3f
commit
c05208ecec
|
|
@ -538,7 +538,7 @@
|
||||||
<target name="scala.compile" depends="init,resolve,gatk.compile,queue-extensions.generate,init.scala.compile" if="include.scala">
|
<target name="scala.compile" depends="init,resolve,gatk.compile,queue-extensions.generate,init.scala.compile" if="include.scala">
|
||||||
<mkdir dir="${scala.classes}"/>
|
<mkdir dir="${scala.classes}"/>
|
||||||
<echo>Building Scala...</echo>
|
<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 refid="scala.source.path" />
|
||||||
<src path="${queue-extensions.source.dir}" />
|
<src path="${queue-extensions.source.dir}" />
|
||||||
<include name="**/*.scala" />
|
<include name="**/*.scala" />
|
||||||
|
|
@ -1219,7 +1219,7 @@
|
||||||
|
|
||||||
<target name="test.scala.compile" depends="test.java.compile,scala.compile" if="include.scala">
|
<target name="test.scala.compile" depends="test.java.compile,scala.compile" if="include.scala">
|
||||||
<echo message="Scala: Compiling test cases!"/>
|
<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" />
|
<src refid="scala.test.source.path" />
|
||||||
<classpath>
|
<classpath>
|
||||||
<path refid="build.results"/>
|
<path refid="build.results"/>
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ class DrmaaJobRunner(val session: Session, val function: CommandLineFunction) ex
|
||||||
// resource of the designated queue to SIGTERM
|
// resource of the designated queue to SIGTERM
|
||||||
session.control(jobId, Session.TERMINATE)
|
session.control(jobId, Session.TERMINATE)
|
||||||
} catch {
|
} catch {
|
||||||
case e =>
|
case e: Exception =>
|
||||||
logger.error("Unable to kill job " + jobId, e)
|
logger.error("Unable to kill job " + jobId, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,7 @@ object Lsf706JobRunner extends Logging {
|
||||||
if (LibBat.lsb_signaljob(runner.jobId, SIGTERM) < 0)
|
if (LibBat.lsb_signaljob(runner.jobId, SIGTERM) < 0)
|
||||||
logger.error(LibBat.lsb_sperror("Unable to kill job " + runner.jobId))
|
logger.error(LibBat.lsb_sperror("Unable to kill job " + runner.jobId))
|
||||||
} catch {
|
} catch {
|
||||||
case e =>
|
case e: Exception=>
|
||||||
logger.error("Unable to kill job " + runner.jobId, e)
|
logger.error("Unable to kill job " + runner.jobId, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,8 @@ class ShellJobRunner(val function: CommandLineFunction) extends CommandLineJobRu
|
||||||
try {
|
try {
|
||||||
controller.tryDestroy()
|
controller.tryDestroy()
|
||||||
} catch {
|
} catch {
|
||||||
case e =>
|
case e: Exception =>
|
||||||
logger.error("Unable to kill shell job: " + function.description)
|
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 java.lang.IllegalStateException
|
||||||
import org.broadinstitute.sting.queue.util._
|
import org.broadinstitute.sting.queue.util._
|
||||||
import org.broadinstitute.sting.utils.io.IOUtils
|
import org.broadinstitute.sting.utils.io.IOUtils
|
||||||
|
import scala.language.reflectiveCalls
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base interface for all functions in Queue.
|
* 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
|
@Argument(doc="The samples to extract from the VCF") var extractSamples : List[String] = samples
|
||||||
|
|
||||||
var out : PrintWriter = _
|
var out : PrintWriter = _
|
||||||
var columns : List[Int] = 0 to 8 toList
|
var columns : List[Int] = (0 to 8).toList
|
||||||
|
|
||||||
def run = {
|
def run = {
|
||||||
out = new PrintWriter(new PrintStream(outputVCF))
|
out = new PrintWriter(new PrintStream(outputVCF))
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
package org.broadinstitute.sting.queue.util
|
package org.broadinstitute.sting.queue.util
|
||||||
|
|
||||||
import org.apache.commons.mail.{MultiPartEmail, EmailAttachment}
|
import org.apache.commons.mail.{MultiPartEmail, EmailAttachment}
|
||||||
import java.io.{FileReader, File}
|
import java.io.{IOException, FileReader, File}
|
||||||
import javax.mail.internet.InternetAddress
|
import javax.mail.internet.InternetAddress
|
||||||
import scala.collection.JavaConversions._
|
import scala.collection.JavaConversions._
|
||||||
|
|
||||||
|
|
@ -105,7 +105,7 @@ class EmailMessage extends Logging {
|
||||||
try {
|
try {
|
||||||
Retry.attempt(() => send(settings), .5)
|
Retry.attempt(() => send(settings), .5)
|
||||||
} catch {
|
} 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
|
package org.broadinstitute.sting.queue.util
|
||||||
|
|
||||||
|
import scala.language.implicitConversions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An importable object that provides automatic primitive to option conversion.
|
* An importable object that provides automatic primitive to option conversion.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ object Retry extends Logging {
|
||||||
result = f()
|
result = f()
|
||||||
success = true
|
success = true
|
||||||
} catch {
|
} catch {
|
||||||
case e => {
|
case e: Exception=> {
|
||||||
count += 1
|
count += 1
|
||||||
if (count < tries) {
|
if (count < tries) {
|
||||||
val minutes = wait(count-1)
|
val minutes = wait(count-1)
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
package org.broadinstitute.sting.queue.util
|
package org.broadinstitute.sting.queue.util
|
||||||
|
|
||||||
import java.io.{Serializable, File}
|
import java.io.{Serializable, File}
|
||||||
|
import scala.language.implicitConversions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts String to/from File
|
* Converts String to/from File
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ object PipelineTest extends BaseTest with Logging {
|
||||||
println("Executing test %s with Queue arguments: %s".format(name, Utils.join(" ",command)))
|
println("Executing test %s with Queue arguments: %s".format(name, Utils.join(" ",command)))
|
||||||
CommandLineProgram.start(instance, command)
|
CommandLineProgram.start(instance, command)
|
||||||
} catch {
|
} catch {
|
||||||
case e =>
|
case e: Exception =>
|
||||||
gotAnException = true
|
gotAnException = true
|
||||||
if (expectedException != null) {
|
if (expectedException != null) {
|
||||||
// we expect an exception
|
// we expect an exception
|
||||||
|
|
@ -224,7 +224,7 @@ object PipelineTest extends BaseTest with Logging {
|
||||||
try {
|
try {
|
||||||
commandLine.shutdown()
|
commandLine.shutdown()
|
||||||
} catch {
|
} catch {
|
||||||
case _ => /* ignore */
|
case _: Throwable => /* ignore */
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue