From bb88586b024c1000c1266447a7b9d9e1f84cb2fc Mon Sep 17 00:00:00 2001 From: Haikal Pribadi Date: Wed, 27 Feb 2019 23:50:45 +0000 Subject: [PATCH] Update Graql (new string escaping behaviour) (#4987) https://github.com/graknlabs/graql/pull/22 --- ConsoleSession.java | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ConsoleSession.java b/ConsoleSession.java index a262d5c5..b2c1640f 100644 --- a/ConsoleSession.java +++ b/ConsoleSession.java @@ -119,39 +119,39 @@ void run() throws IOException, InterruptedException { consoleReader.print(COPYRIGHT); tx = session.transaction().write(); - String queryString; + String input; - while ((queryString = consoleReader.readLine()) != null) { - if (queryString.equals(EDITOR)) { + while ((input = consoleReader.readLine()) != null) { + if (input.equals(EDITOR)) { executeQuery(openTextEditor()); - } else if (queryString.startsWith(LOAD + ' ')) { + } else if (input.startsWith(LOAD + ' ')) { try{ - queryString = readFile(Paths.get(unescapeJava(queryString.substring(LOAD.length() + 1)))); - executeQuery(queryString); + input = readFile(Paths.get(unescapeJava(input.substring(LOAD.length() + 1)))); + executeQuery(input); } catch (NoSuchFileException e) { System.err.println("File not found: " + e.getMessage()); } - } else if (queryString.equals(COMMIT)) { + } else if (input.equals(COMMIT)) { commit(); - } else if (queryString.equals(ROLLBACK)) { + } else if (input.equals(ROLLBACK)) { rollback(); - } else if (queryString.equals(CLEAN)) { + } else if (input.equals(CLEAN)) { clean(); consoleReader.flush(); return; - } else if (queryString.equals(CLEAR)) { + } else if (input.equals(CLEAR)) { consoleReader.clearScreen(); - } else if (queryString.equals(EXIT)) { + } else if (input.equals(EXIT)) { consoleReader.flush(); return; - } else if (!queryString.isEmpty()) { - executeQuery(queryString); + } else if (!input.isEmpty()) { + executeQuery(input); } // We ignore empty commands }