diff options
author | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2020-01-15 01:58:07 +0100 |
---|---|---|
committer | Magdalena Grodzińska <mag.grodzinska@gmail.com> | 2020-01-15 01:58:07 +0100 |
commit | 5096d5fdc1a550a53511ca4478394f778cef10be (patch) | |
tree | 8c1cffd6adadaf17b09880e8fb9487b0fe553f33 | |
parent | 173107de2e648f4accbe1d303ad100bed891d697 (diff) |
Fix tests
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java b/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java index e577c13..2ca0c38 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueQuery.java @@ -28,27 +28,27 @@ public class ValueQuery extends Value { * * @param query the code of the query */ -// public ValueQuery(String query) throws Exception { -// this.code = query; -// if (!query.isEmpty()) { -// Yylex lex = new Yylex(new ByteArrayInputStream(query.getBytes())); -// this.query = (new parser(lex)).pProgram(); -// } -// this.signature = null; -// this.timestamp = System.currentTimeMillis(); -// this.installed = true; -// } - -// public ValueQuery(String query, byte[] querySignature) throws Exception { -// this.code = query; -// if (!query.isEmpty()) { -// Yylex lex = new Yylex(new ByteArrayInputStream(query.getBytes())); -// this.query = (new parser(lex)).pProgram(); -// } -// this.signature = querySignature; -// this.timestamp = System.currentTimeMillis(); -// this.installed = true; -// } + public ValueQuery(String query) throws Exception { + this.code = query; + if (!query.isEmpty()) { + Yylex lex = new Yylex(new ByteArrayInputStream(query.getBytes())); + this.query = (new parser(lex)).pProgram(); + } + this.signature = null; + this.timestamp = System.currentTimeMillis(); + this.installed = true; + } + + public ValueQuery(String query, byte[] querySignature) throws Exception { + this.code = query; + if (!query.isEmpty()) { + Yylex lex = new Yylex(new ByteArrayInputStream(query.getBytes())); + this.query = (new parser(lex)).pProgram(); + } + this.signature = querySignature; + this.timestamp = System.currentTimeMillis(); + this.installed = true; + } public ValueQuery(QueryData queryData) throws Exception { this.code = queryData.getCode(); |