<commit_before>package zephyr.plugin.common.views;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

import rlpark.plugin.utils.events.Listener;
import rlpark.plugin.utils.events.Signal;
import rlpark.plugin.utils.time.Clock;
import rlpark.plugin.utils.time.ClockKillable;

public class ViewBinder {
  public Signal<Clock> onClockAdded = new Signal<Clock>();
  private List<TimedView> views = null;
  protected final Map<Clock, ClockViews> clockToView = new HashMap<Clock, ClockViews>();
  private final Listener<Clock> onClockKilledListener = new Listener<Clock>() {
    @Override
    public void listen(Clock clock) {
      ClockViews clockViews = clockToView.get(clock);
      for (SyncView view : clockViews.getViews())
        unbind(clock, view);
    }
  };

  public ViewBinder() {
  }

  protected List<TimedView> createViews() {
    List<TimedView> listeners = new ArrayList<TimedView>();
    IConfigurationElement[] config = Platform.getExtensionRegistry()
        .getConfigurationElementsFor("zephyr.plugin.common.views.timedview");
    for (IConfigurationElement element : config) {
      Object o;
      try {
        o = element.createExecutableExtension("class");
        if (o instanceof TimedView)
          listeners.add((TimedView) o);
      } catch (CoreException e) {
        e.printStackTrace();
      }
    }
    return listeners;
  }
<commit_msg>Return when views have already been unbind<commit_after>package zephyr.plugin.common.views;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

import rlpark.plugin.utils.events.Listener;
import rlpark.plugin.utils.events.Signal;
import rlpark.plugin.utils.time.Clock;
import rlpark.plugin.utils.time.ClockKillable;

public class ViewBinder {
  public Signal<Clock> onClockAdded = new Signal<Clock>();
  private List<TimedView> views = null;
  protected final Map<Clock, ClockViews> clockToView = new HashMap<Clock, ClockViews>();
  private final Listener<Clock> onClockKilledListener = new Listener<Clock>() {
    @Override
    public void listen(Clock clock) {
      ClockViews clockViews = clockToView.get(clock);
      if (clockViews == null)
        return;
      for (SyncView view : clockViews.getViews())
        unbind(clock, view);
    }
  };

  public ViewBinder() {
  }

  protected List<TimedView> createViews() {
    List<TimedView> listeners = new ArrayList<TimedView>();
    IConfigurationElement[] config = Platform.getExtensionRegistry()
        .getConfigurationElementsFor("zephyr.plugin.common.views.timedview");
    for (IConfigurationElement element : config) {
      Object o;
      try {
        o = element.createExecutableExtension("class");
        if (o instanceof TimedView)
          listeners.add((TimedView) o);
      } catch (CoreException e) {
        e.printStackTrace();
      }
    }
    return listeners;
  }

{'fraction_non_alphanumeric': 0.10955585464333782, 'fraction_numerical': 0.0, 'mean_word_length': 4.118457300275482, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6648025', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1096, 'n_words': 234}