private void makeFirstElement(int index) { String[] newComments = new String[previousComments.length]; newComments[0] = previousComments[index]; System.arraycopy(previousComments, 0, newComments, 1, index); int maxIndex = previousComments.length - 1; if (index != maxIndex) { int nextIndex = (index + 1); System.arraycopy(previousComments, nextIndex, newComments, nextIndex, (maxIndex - index)); } previousComments = newComments; }
public ICVSRemoteResource[] getFoldersForTag( ICVSRepositoryLocation location, CVSTag tag, IProgressMonitor monitor) throws CVSException { monitor = Policy.monitorFor(monitor); try { monitor.beginTask( NLS.bind( CVSUIMessages.RepositoryManager_fetchingRemoteFolders, new String[] {tag.getName()}), 100); if (tag.getType() == CVSTag.HEAD) { ICVSRemoteResource[] resources = location.members(tag, false, Policy.subMonitorFor(monitor, 60)); RepositoryRoot root = getRepositoryRootFor(location); ICVSRemoteResource[] modules = root.getDefinedModules(tag, Policy.subMonitorFor(monitor, 40)); ICVSRemoteResource[] result = new ICVSRemoteResource[resources.length + modules.length]; System.arraycopy(resources, 0, result, 0, resources.length); System.arraycopy(modules, 0, result, resources.length, modules.length); return result; } if (tag.getType() == CVSTag.DATE) { ICVSRemoteResource[] resources = location.members(tag, false, Policy.subMonitorFor(monitor, 60)); RepositoryRoot root = getRepositoryRootFor(location); ICVSRemoteResource[] modules = root.getDefinedModules(tag, Policy.subMonitorFor(monitor, 40)); ICVSRemoteResource[] result = new ICVSRemoteResource[resources.length + modules.length]; System.arraycopy(resources, 0, result, 0, resources.length); System.arraycopy(modules, 0, result, resources.length, modules.length); return result; } Set result = new HashSet(); // Get the tags for the location RepositoryRoot root = getRepositoryRootFor(location); String[] paths = root.getKnownRemotePaths(); for (int i = 0; i < paths.length; i++) { String path = paths[i]; List tags = Arrays.asList(root.getAllKnownTags(path)); if (tags.contains(tag)) { ICVSRemoteFolder remote = root.getRemoteFolder(path, tag, Policy.subMonitorFor(monitor, 100)); result.add(remote); } } return (ICVSRemoteResource[]) result.toArray(new ICVSRemoteResource[result.size()]); } finally { monitor.done(); } }
public void setMaxComments(int maxComments) { if (maxComments > 0) { this.maxComments = maxComments; if (maxComments < previousComments.length) { String[] newComments = new String[maxComments]; System.arraycopy(previousComments, 0, newComments, 0, maxComments); previousComments = newComments; } } }