Merge branch 'master' of ssh://nickel.broadinstitute.org/humgen/gsa-scr1/gsa-engineering/git/unstable

This commit is contained in:
Ryan Poplin 2011-10-17 14:35:14 -04:00
commit 589df6b7cf
3 changed files with 8 additions and 8 deletions

View File

@ -380,7 +380,7 @@ class RodBindingArgumentTypeDescriptor extends ArgumentTypeDescriptor {
if ( tribbleType == null )
if ( ! file.canRead() | ! file.isFile() ) {
throw new UserException.BadArgumentValue(name, "Couldn't read file to determine type: " + file);
throw new UserException.CouldNotReadInputFile(file, "file does exist or couldn't be read");
} else {
throw new UserException.CommandLineException(
String.format("No tribble type was provided on the command line and the type of the file could not be determined dynamically. " +

View File

@ -46,7 +46,7 @@ public class SimpleTimer {
* @return the name associated with this timer
*/
@Ensures("result != null")
public String getName() {
public synchronized String getName() {
return name;
}
@ -82,14 +82,14 @@ public class SimpleTimer {
/**
* @return is this timer running?
*/
public boolean isRunning() {
public synchronized boolean isRunning() {
return running;
}
/**
* @return A convenience function to obtain the current time in milliseconds from this timer
*/
public long currentTime() {
public synchronized long currentTime() {
return System.currentTimeMillis();
}
@ -119,8 +119,4 @@ public class SimpleTimer {
public synchronized double getElapsedTime() {
return (running ? (currentTime() - startTime + elapsed) : elapsed) / 1000.0;
}
public void printElapsedTime(PrintStream out) {
out.printf("SimpleTimer %s: %.2f%n", name, getElapsedTime());
}
}

View File

@ -111,6 +111,10 @@ public class UserException extends ReviewedStingException {
super(String.format("Couldn't read file because %s caused by %s", message, e.getMessage()));
}
public CouldNotReadInputFile(File file) {
super(String.format("Couldn't read file %s", file.getAbsolutePath()));
}
public CouldNotReadInputFile(File file, String message) {
super(String.format("Couldn't read file %s because %s", file.getAbsolutePath(), message));
}