public void replace(
     final List<BaseInjection> originalInjections, final List<BaseInjection> newInjections) {
   for (Iterator<InjInfo> it = injectionInfos.iterator(); it.hasNext(); ) {
     final InjInfo info = it.next();
     if (originalInjections.contains(info.injection)) it.remove();
   }
   for (BaseInjection newInjection : newInjections) {
     injectionInfos.add(new InjInfo(newInjection, this));
   }
 }
Exemplo n.º 2
0
 public void removeAllIconRenderers(IconRendererType type) {
   assert SwingUtilities.isEventDispatchThread()
       : "LeftEditorHighlighter.removeAllIconRenderers() should be called in eventDispatchThread";
   boolean wasModified = false;
   for (Iterator<EditorMessageIconRenderer> it = myIconRenderers.iterator(); it.hasNext(); ) {
     EditorMessageIconRenderer renderer = it.next();
     if (renderer.getType() == type) {
       it.remove();
       wasModified = true;
     }
   }
   if (wasModified) {
     relayoutOnIconRendererChanges();
   }
 }
 @NotNull
 public static Collection<GitRemote> getRemotesWithCommonNames(
     @NotNull Collection<GitRepository> repositories) {
   if (repositories.isEmpty()) {
     return Collections.emptyList();
   }
   Iterator<GitRepository> iterator = repositories.iterator();
   List<GitRemote> commonRemotes = new ArrayList<GitRemote>(iterator.next().getRemotes());
   while (iterator.hasNext()) {
     GitRepository repository = iterator.next();
     Collection<String> remoteNames = getRemoteNames(repository);
     for (Iterator<GitRemote> commonIter = commonRemotes.iterator(); commonIter.hasNext(); ) {
       GitRemote remote = commonIter.next();
       if (!remoteNames.contains(remote.getName())) {
         commonIter.remove();
       }
     }
   }
   return commonRemotes;
 }