You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@joshua.apache.org by mj...@apache.org on 2016/06/13 15:16:01 UTC
[2/2] incubator-joshua git commit: bugfix: error in handling metadata
with no args
bugfix: error in handling metadata with no args
Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/952a82d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/952a82d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/952a82d5
Branch: refs/heads/master
Commit: 952a82d5a4f640532f4512b27d09a65f2ec19af1
Parents: e514d2f
Author: Matt Post <po...@cs.jhu.edu>
Authored: Mon Jun 13 08:15:56 2016 -0700
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Mon Jun 13 08:15:56 2016 -0700
----------------------------------------------------------------------
src/main/java/org/apache/joshua/server/ServerThread.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/952a82d5/src/main/java/org/apache/joshua/server/ServerThread.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/server/ServerThread.java b/src/main/java/org/apache/joshua/server/ServerThread.java
index 0187ad1..ccadc2d 100644
--- a/src/main/java/org/apache/joshua/server/ServerThread.java
+++ b/src/main/java/org/apache/joshua/server/ServerThread.java
@@ -169,7 +169,7 @@ public class ServerThread extends Thread implements HttpHandler {
LOG.info("TRANSLATION: '{}' with {} k-best items", translation, translation.getStructuredTranslations().size());
message.addTranslation(translation);
}
-
+
OutputStream out = new HttpWriter(client);
out.write(message.toString().getBytes());
if (LOG.isDebugEnabled())
@@ -188,7 +188,7 @@ public class ServerThread extends Thread implements HttpHandler {
private String handleMetadata(String meta) {
String[] tokens = meta.split("\\s+", 2);
String type = tokens[0];
- String args = tokens[1];
+ String args = tokens.length > 1 ? tokens[1] : "";
String response = "";
if (type.equals("get_weight")) {