void addArrayList ( Node firstInList ) { boolean lastWasEmpty = false ; for ( Node n = firstInList ; n != null ; n = n . getNext ( ) ) { if ( n != firstInList ) { cc . listSeparator ( ) ; } addExpr ( n , 1 , Context . OTHER ) ; lastWasEmpty = n . isEmpty ( ) ; } if ( lastWasEmpty ) { cc . listSeparator ( ) ; } }
This function adds a comma - separated list as is specified by an ARRAYLIT node with the associated skipIndexes array . This is a space optimization since we avoid creating a whole Node object for each empty array literal slot .