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:
Louis Bergelson 2013-08-30 16:43:21 -04:00
parent b32ad99d3f
commit c05208ecec
11 changed files with 16 additions and 12 deletions

View File

@ -538,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" />
@ -1219,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"/>

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}
}

View File

@ -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.

View File

@ -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))

View File

@ -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)
}
}

View File

@ -25,6 +25,8 @@
package org.broadinstitute.sting.queue.util
import scala.language.implicitConversions
/**
* An importable object that provides automatic primitive to option conversion.
*/

View File

@ -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)

View File

@ -26,6 +26,7 @@
package org.broadinstitute.sting.queue.util
import java.io.{Serializable, File}
import scala.language.implicitConversions
/**
* Converts String to/from File

View File

@ -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 */
})
}
})