提交 9f13c572 authored 作者: Thomas Mueller's avatar Thomas Mueller

Array literals with zero or one element were not be parsed correctly (Tomcat…

Array literals with zero or one element were not be parsed correctly (Tomcat would reset the fields).
上级 6e8f8506
...@@ -2483,7 +2483,7 @@ public class Parser { ...@@ -2483,7 +2483,7 @@ public class Parser {
case OPEN: case OPEN:
read(); read();
if (readIf(")")) { if (readIf(")")) {
r = ExpressionList.EMPTY; r = new ExpressionList(new Expression[0]);
} else { } else {
r = readExpression(); r = readExpression();
if (readIf(",")) { if (readIf(",")) {
......
...@@ -20,8 +20,6 @@ import org.h2.value.ValueArray; ...@@ -20,8 +20,6 @@ import org.h2.value.ValueArray;
*/ */
public class ExpressionList extends Expression { public class ExpressionList extends Expression {
public static final ExpressionList EMPTY = new ExpressionList(new Expression[0]);
private Expression[] list; private Expression[] list;
public ExpressionList(Expression[] list) { public ExpressionList(Expression[] list) {
......
...@@ -16,8 +16,6 @@ import org.h2.util.StatementBuilder; ...@@ -16,8 +16,6 @@ import org.h2.util.StatementBuilder;
*/ */
public class ValueArray extends Value { public class ValueArray extends Value {
private static final ValueArray EMPTY = new ValueArray(new Value[0]);
private final Value[] values; private final Value[] values;
private int hash; private int hash;
...@@ -33,7 +31,7 @@ public class ValueArray extends Value { ...@@ -33,7 +31,7 @@ public class ValueArray extends Value {
* @return the value * @return the value
*/ */
public static ValueArray get(Value[] list) { public static ValueArray get(Value[] list) {
return list.length == 0 ? EMPTY : new ValueArray(list); return new ValueArray(list);
} }
public int hashCode() { public int hashCode() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论