void saveRemainingPatches( final ShelvedChangeList changeList, final List<FilePatch> remainingPatches, final List<ShelvedBinaryFile> remainingBinaries, CommitContext commitContext) { final File newPath = getPatchPath(changeList.DESCRIPTION); try { FileUtil.copy(new File(changeList.PATH), newPath); } catch (IOException e) { // do not delete if cannot recycle return; } final ShelvedChangeList listCopy = new ShelvedChangeList( newPath.getAbsolutePath(), changeList.DESCRIPTION, new ArrayList<ShelvedBinaryFile>(changeList.getBinaryFiles())); listCopy.DATE = (changeList.DATE == null) ? null : new Date(changeList.DATE.getTime()); writePatchesToFile(myProject, changeList.PATH, remainingPatches, commitContext); changeList.getBinaryFiles().retainAll(remainingBinaries); changeList.clearLoadedChanges(); recycleChangeList(listCopy, changeList); notifyStateChanged(); }