Added default values for start and end date. Now they are only updated when timing is enabled.
Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/dcce8f7d Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/dcce8f7d Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/dcce8f7d Branch: refs/heads/prestonc/parser Commit: dcce8f7de63aaa807e6a8d46d82c75b4aa062b7d Parents: b594f02 Author: Preston Carman <[email protected]> Authored: Wed Feb 19 11:21:56 2014 -0800 Committer: Preston Carman <[email protected]> Committed: Wed Feb 19 11:21:56 2014 -0800 ---------------------------------------------------------------------- .../src/main/java/org/apache/vxquery/cli/VXQuery.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/dcce8f7d/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java ---------------------------------------------------------------------- diff --git a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java index da6f40b..7e3abfc 100644 --- a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java +++ b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java @@ -169,8 +169,8 @@ public class VXQuery { * @throws Exception */ private void runQueries() throws IOException, SystemException, Exception { - Date start; - Date end; + Date start = null; + Date end = null; for (String query : opts.arguments) { String qStr = slurp(query); if (opts.showQuery) { @@ -248,7 +248,7 @@ public class VXQuery { } }; - start = new Date(); + start = opts.timing ? new Date() : null; XMLQueryCompiler compiler = new XMLQueryCompiler(listener, getNodeList(), opts.frameSize); resultSetId = createResultSetId(); CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(RootStaticContextImpl.INSTANCE), @@ -274,7 +274,7 @@ public class VXQuery { PrintWriter writer = new PrintWriter(System.out, true); // Repeat execution for number of times provided in -repeatexec argument for (int i = 0; i < opts.repeatExec; ++i) { - start = new Date(); + start = opts.timing ? new Date() : null; runJob(js, writer); // if -timing argument passed, show the starting and ending times if (opts.timing) {
