diff src/main/java/org/monetdb/merovingian/Control.java @ 497:aed7f32e029a onclient

Refactor LineType to be an enum Makes it easier to catch them all when changing things.
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Fri, 13 Aug 2021 10:26:56 +0200 (2021-08-13)
parents bf9f6b6ecf40
children 6aa38e8c0f2d
line wrap: on
line diff
--- a/src/main/java/org/monetdb/merovingian/Control.java
+++ b/src/main/java/org/monetdb/merovingian/Control.java
@@ -207,17 +207,17 @@ public class Control {
 		mout.writeLine(database + " " + command + "\n");
 		ArrayList<String> l = new ArrayList<String>();
 		String tmpLine = min.readLine();
-		int linetype = min.getLineType();
-		if (linetype == BufferedMCLReader.ERROR)
+		LineType linetype = min.getLineType();
+		if (linetype == LineType.ERROR)
 			throw new MerovingianException(tmpLine.substring(6));
-		if (linetype != BufferedMCLReader.RESULT)
+		if (linetype != LineType.RESULT)
 			throw new MerovingianException("unexpected line: " + tmpLine);
 		if (!tmpLine.substring(1).equals(RESPONSE_OK))
 			throw new MerovingianException(tmpLine.substring(1));
 		tmpLine = min.readLine();
 		linetype = min.getLineType();
-		while (linetype != BufferedMCLReader.PROMPT) {
-			if (linetype != BufferedMCLReader.RESULT)
+		while (linetype != LineType.PROMPT) {
+			if (linetype != LineType.RESULT)
 				throw new MerovingianException("unexpected line: " +
 						tmpLine);