From b423ff3cd71a3069ab7f6ac7ab8f2808cf4a0891 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Wed, 14 May 2014 14:32:57 +0400 Subject: [PATCH] Add ArrayFactory to JetExpression --- .../src/org/jetbrains/jet/lang/psi/JetExpression.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpression.java index 0ed62ea7b6e..052f67dc076 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetExpression.java @@ -16,9 +16,20 @@ package org.jetbrains.jet.lang.psi; +import com.intellij.util.ArrayFactory; import org.jetbrains.annotations.NotNull; public interface JetExpression extends JetElement { + JetExpression[] EMPTY_ARRAY = new JetExpression[0]; + + ArrayFactory ARRAY_FACTORY = new ArrayFactory() { + @NotNull + @Override + public JetExpression[] create(int count) { + return count == 0 ? EMPTY_ARRAY : new JetExpression[count]; + } + }; + @Override R accept(@NotNull JetVisitor visitor, D data); }