33import java .lang .reflect .Array ;
44import java .lang .reflect .InvocationTargetException ;
55
6- /**
7- * New object, new array, or inner class style allocation with body.
8- */
6+ /** New object, new array, or inner class style allocation with body. */
97class BSHAllocationExpression extends SimpleNode {
10- private static int innerClassCount = 0 ;
11-
128 BSHAllocationExpression (int id ) {
139 super (id );
1410 }
1511
12+ private static int innerClassCount = 0 ;
13+
1614 public Object eval (CallStack callstack , Interpreter interpreter ) throws EvalError {
1715 // type is either a class name or a primitive type
1816 SimpleNode type = (SimpleNode ) jjtGetChild (0 );
@@ -210,7 +208,7 @@ when VOID the prescribed array dimensions (defined and undefined)
210208 /**
211209 * Create an array of the dimensions specified in dimensionsNode. dimensionsNode may contain a
212210 * number of "undefined" as well as "defined" dimensions.
213- * <p>
211+ *
214212 * <p>Background: in Java arrays are implemented in arrays-of-arrays style where, for example, a
215213 * two dimensional array is a an array of arrays of some base type. Each dimension-type has a
216214 * Java class type associated with it... so if foo = new int[5][5] then the type of foo is int
@@ -219,7 +217,7 @@ when VOID the prescribed array dimensions (defined and undefined)
219217 * if foo = new int [5][]; then foo[0] == null //true; and can later be assigned with the
220218 * appropriate type, e.g. foo[0] = new int[5]; (See Learning Java, O'Reilly & Associates more
221219 * background).
222- * <p>
220+ *
223221 * <p>To create an array with undefined trailing dimensions using the reflection API we must use
224222 * an array type to represent the lower order (undefined) dimensions as the "base" type for the
225223 * array creation... Java will then create the correct type by adding the dimensions of the base
0 commit comments