简单的复制出新对象ArrayList
548752
public static <S, D> List<D> mapList(Iterable<S> sourceList, Class<D> destinationClass) {
		List<D> destinationList = new ArrayList<D>();
		for (S source : sourceList) {
			if (source != null) {
				destinationList.add(mapper.map(source, destinationClass));
			}
		}
		return destinationList;
	}
1294023
@Override
	public void updateArray(final int columnIndex, final Array x) throws SQLException {
		wrapped.updateArray(columnIndex, x);
	}
1257492
private Object updateBufferedListModel(final Object wrappedCollection) {
        if (bufferedListModel == null) {
            bufferedListModel = createBufferedListModel();
            bufferedListModel.addListDataListener(listChangeHandler);
            setValue(bufferedListModel);
        }
        if (wrappedCollection == null) {
            bufferedListModel.clear();
        }
        else {
            if (wrappedType.isAssignableFrom(wrappedCollection.getClass())) {
                Collection buffer = null;
                if (wrappedCollection instanceof Object[]) {
                    Object[] wrappedArray = (Object[])wrappedCollection;
                    buffer = Arrays.asList(wrappedArray);
                }
                else {
                    buffer = (Collection)wrappedCollection;
                }
                bufferedListModel.clear();
                bufferedListModel.addAll(prepareBackingCollection(buffer));
            }
            else {
                throw new IllegalArgumentException("wrappedCollection must be assignable from " + wrappedType.getName());
            }

        }
        return bufferedListModel;
    }
110377
public void addUpdate(final Update update) {
        if (updates == null) {
            updates = new ArrayList<Update>();
        }
        updates.add(update);
    }
821857
private void appendList(Output out, Collection collection, String separator, boolean areColumns) {
        Iterator it = collection.iterator();
        boolean hasNext = it.hasNext();
        //boolean areColumns = (columns == collection);

        while (hasNext) {
            Outputable sqlToken = (Outputable) it.next();
            hasNext = it.hasNext();
            sqlToken.write(out);
            if (areColumns) {
                Column column = (Column) sqlToken;
                String columnAlias = column.getAlias();
                if (columnAlias != null) {
                    out.print(" AS ");
                    out.print("\"");
                    out.print(columnAlias);
                    out.print("\"");
                }
            }
            if (hasNext) {
                out.print(separator);
                out.println();
            }
        }
    }
694666
private void updateValue() {
        if (table != null) {
            int oldCount = this.count;
            this.count = table.getSelectedRowCount();
            maybeNotifyListeners(oldCount, count);
        }
    }
121078
protected void updated()
    {
        if (remaining < 0 && remaining > capacity)
        {
            throw new IllegalArgumentException(remaining+" illegal remaining at %s"+toString());
        }
        if (marked < 0 && marked > capacity)
        {
            throw new IllegalArgumentException(marked+" illegal marked at %s"+toString());
        }
    }
1241486
def update(self, iterable):
        """"""
        _lists = self._lists
        _maxes = self._maxes
        values = sorted(iterable)

        if _maxes:
            if len(values) * 4 >= self._len:
                values.extend(chain.from_iterable(_lists))
                values.sort()
                self._clear()
            else:
                _add = self.add
                for val in values:
                    _add(val)
                return

        _load = self._load
        _lists.extend(values[pos:(pos + _load)]
                      for pos in range(0, len(values), _load))
        _maxes.extend(sublist[-1] for sublist in _lists)
        self._len = len(values)
        del self._index[:]
547550
public void addAll(StringArrayList vec) {
        int i;
        int max;

        max = vec.size();
        for (i = 0; i < max; i++) {
            add(vec.get(i));
        }
    }
370672
private void updateArrayOfGetters(ClassOutline co, JCodeModel model) {
    JDefinedClass implClass = co.implClass;

    List<JMethod> removedMethods = new ArrayList<>();
    Iterator<JMethod> iter = implClass.methods().iterator();
    while (iter.hasNext()) {
      JMethod method = iter.next();
      if (method.type().name().startsWith("ArrayOf")) {
        removedMethods.add(method);
        iter.remove();
      }
    }

    for (JMethod removed : removedMethods) {
      // Parse the old code to get the variable name
      StringWriter oldWriter = new StringWriter();
      removed.body().state(new JFormatter(oldWriter));
      String oldBody = oldWriter.toString();
      String varName = oldBody.substring(oldBody.indexOf("return ") + "return ".length(), oldBody.indexOf(";"));

      // Build the new method
      JClass newReturnType = (JClass) ((JDefinedClass) removed.type()).fields().values().iterator().next().type();
      JMethod newMethod = implClass.method(removed.mods().getValue(), newReturnType, removed.name());
      JFieldVar field = implClass.fields().get(varName);          
      JClass typeParameter = newReturnType.getTypeParameters().get(0);
      String fieldName = model._getClass(field.type().fullName()).fields().keySet().iterator().next();

      newMethod.body()._return(
          JOp.cond(field.eq(JExpr._null()),
              JExpr._new(model.ref("java.util.ArrayList").narrow(typeParameter)),
              field.invoke("get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1))));
    }    
  }
1006908
function queryRefresh(queryList) {
    var queryListImpl = queryList;
    if (queryList.dirty) {
        queryList.reset(queryListImpl._valuesTree);
        queryList.notifyOnChanges();
        return true;
    }
    return false;
}
552869
public void newDataReady(DataType data) {
		ArrayList<Runnable> list;
		synchronized (this) {
			if (end) throw new IllegalStateException("method endOfData already called, method newDataReady is not allowed anymore");
			waitingData.addLast(data);
			list = listeners;
			listeners = null;
		}
		if (list != null) {
			for (Runnable listener : list) listener.run();
		}
		// notify after listeners
		synchronized (this) {
			this.notify();
		}
	}
466429
protected void refreshListUI() {
		final Display display = Display.getDefault();
		if (display.getThread().equals(Thread.currentThread())) {
			if (!this.list.isBusy()) {
				this.list.refresh();
			}
		} else {
			display.syncExec(new Runnable() {
				@SuppressWarnings("synthetic-access")
				@Override
				public void run() {
					if (!AbstractConversionTable.this.list.isBusy()) {
						AbstractConversionTable.this.list.refresh();
					}
				}
			});
		}
	}
73595
public static <T> ArrayList<T> newArrayList(Iterable<T> iterable) {
		return (ArrayList<T>) list(false, iterable);
	}
1233852
protected Map<String, Map<Integer, Set<String>>> createUpdateList() {
    Map<String, Map<Integer, Set<String>>> updateList = new HashMap<>();
    updateList.put(UPDATE_TYPE_OFFSET, new HashMap<>());
    updateList.put(UPDATE_TYPE_POSITION, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_START, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_POSITION_END, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_START, new HashMap<>());
    updateList.put(UPDATE_TYPE_LOCAL_REF_OFFSET_END, new HashMap<>());
    updateList.put(UPDATE_TYPE_VARIABLE, new HashMap<>());
    return updateList;
  }
397634
int createList(int listData) {
		int list = newList_();
		// m_lists.set_field(list, 0, null_node());//head
		// m_lists.set_field(list, 1, null_node());//tail
		// m_lists.set_field(list, 2, null_node());//prev list
		m_lists.setField(list, 3, m_list_of_lists); // next list
		m_lists.setField(list, 4, 0);// node count in the list
		m_lists.setField(list, 5, listData);
		if (m_list_of_lists != nullNode())
			setPrevList_(m_list_of_lists, list);

		m_list_of_lists = list;
		return list;
	}
299071
public final void forUpdate() throws RecognitionException {
		int forUpdate_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 103) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1097:5: ( expressionList )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1097:7: expressionList
			{
			pushFollow(FOLLOW_expressionList_in_forUpdate4775);
			expressionList();
			state._fsp--;
			if (state.failed) return;
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 103, forUpdate_StartIndex); }

		}
	}