Update of /cvsroot/nice/Nice/stdlib/nice/lang
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5377/stdlib/nice/lang
Modified Files:
rawArray.java
Log Message:
Use more typing information from the context when deciding what bytecode types
to use for literal arrays and tuples, especially when they are nested inside
other literal arrays or tuples. This allows to generate more efficient code,
and fixes several runtime errors (fixes #761629 and #892625).
Index: rawArray.java
===================================================================
RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/rawArray.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** rawArray.java 9 Feb 2004 12:25:58 -0000 1.13
--- rawArray.java 11 Feb 2004 12:46:39 -0000 1.14
***************
*** 370,374 ****
boolean primitiveArray =
componentClass.charAt(0) == '[' &&
! componentClass.charAt(1) != 'L';
for (int i = len; --i >= 0;) {
--- 370,379 ----
boolean primitiveArray =
componentClass.charAt(0) == '[' &&
! componentClass.charAt(1) != 'L' &&
! componentClass.charAt(1) != '[';
!
! boolean collection =
! componentClass.equals("java.util.Collection") ||
! componentClass.equals("java.util.List");
for (int i = len; --i >= 0;) {
***************
*** 377,380 ****
--- 382,387 ----
if (primitiveArray)
value = convertPrimitive(value, componentClass.substring(1));
+ else if (collection)
+ value = rawArray.make(value);
Array.set(res, i, value);
|