Revision: 14494
http://gate.svn.sourceforge.net/gate/?rev=14494&view=rev
Author: markagreenwood
Date: 2011-11-04 15:06:32 +0000 (Fri, 04 Nov 2011)
Log Message:
-----------
more logical null handling
Modified Paths:
--------------
gate/trunk/src/gate/util/CorpusBenchmarkTool.java
gate/trunk/src/gate/util/CorpusSaver.java
Modified: gate/trunk/src/gate/util/CorpusBenchmarkTool.java
===================================================================
--- gate/trunk/src/gate/util/CorpusBenchmarkTool.java 2011-11-04 12:29:42 UTC
(rev 14493)
+++ gate/trunk/src/gate/util/CorpusBenchmarkTool.java 2011-11-04 15:06:32 UTC
(rev 14494)
@@ -37,17 +37,16 @@
public CorpusBenchmarkTool() {}
public void initPRs() {
+ if (applicationFile == null)
+ throw new GateRuntimeException("Application not set!");
+
try {
- if (applicationFile == null)
- Out.prln("Application not set!");
Out.prln("App file is: " + applicationFile.getAbsolutePath());
application = (Controller) gate.util.persistence.PersistenceManager
.loadObjectFromFile(applicationFile);
}
catch (Exception ex) {
- throw (GateRuntimeException)
- new GateRuntimeException("Corpus Benchmark Tool:" + ex.getMessage())
- .initCause(ex);
+ throw new GateRuntimeException("Corpus Benchmark Tool:" +
ex.getMessage(), ex);
}
} //initPRs
Modified: gate/trunk/src/gate/util/CorpusSaver.java
===================================================================
--- gate/trunk/src/gate/util/CorpusSaver.java 2011-11-04 12:29:42 UTC (rev
14493)
+++ gate/trunk/src/gate/util/CorpusSaver.java 2011-11-04 15:06:32 UTC (rev
14494)
@@ -58,15 +58,17 @@
}
public void initPRs() {
+ if (applicationFile == null)
+ throw new GateRuntimeException("Application not set!");
+
try {
- if (applicationFile == null)
- Out.prln("Application not set!");
Out.prln("App file is: " + applicationFile.getAbsolutePath());
application = (Controller) gate.util.persistence.PersistenceManager
- .loadObjectFromFile(applicationFile);
- } catch (Exception ex) {
- throw new GateRuntimeException("Corpus Saver: "+ex.getMessage());
+ .loadObjectFromFile(applicationFile);
}
+ catch (Exception ex) {
+ throw new GateRuntimeException("Corpus Benchmark Tool:" +
ex.getMessage(), ex);
+ }
}//initPRs
public void execute() {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs