<commit_before>package com.codeaffine.eclipse.core.runtime;

import static com.codeaffine.eclipse.core.runtime.ArgumentVerification.verifyNotNull;

import org.eclipse.core.runtime.IExtensionRegistry;

import com.codeaffine.eclipse.core.runtime.internal.OperatorFactory;

public class RegistryAdapter {

  public static final String DEFAULT_TYPE_ATTRIBUTE = "class";

  private final OperatorFactory factory;

  interface SingleSelector<T> {
    SingleProcessor<T> ofContributionTo( String extensionPointId );
  }

  interface ForEachSelector<T> {
    MultiProcessor<T> forEachContributionTo( String extensionPointId );
  }

  interface ExecutableExtensionConfiguration<T> {
    ExecutableExtensionConfiguration<T> withConfiguration( ExecutableExtensionConfigurator<T> configurator );
    ExecutableExtensionConfiguration<T> withExceptionHandler( ExtensionExceptionHandler exceptionHandler );
    ExecutableExtensionConfiguration<T> withTypeAttribute( String typeAttribute);
  }

  public RegistryAdapter( IExtensionRegistry registry ) {
    verifyNotNull( registry, "registry" );

    this.factory = new OperatorFactory( registry );
  }

  public ExtensionReader readExtension() {
    return new ExtensionReader( factory.newReadExtensionOperator() );
  }

  public ExtensionsReader readExtensions() {
    return new ExtensionsReader( factory.newReadExtensionsOperator() );
  }<commit_msg>Introduction of convenient constructor for RegistryAdapter<commit_after>package com.codeaffine.eclipse.core.runtime;

import static com.codeaffine.eclipse.core.runtime.ArgumentVerification.verifyNotNull;

import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;

import com.codeaffine.eclipse.core.runtime.internal.OperatorFactory;

public class RegistryAdapter {

  public static final String DEFAULT_TYPE_ATTRIBUTE = "class";

  private final OperatorFactory factory;

  interface SingleSelector<T> {
    SingleProcessor<T> ofContributionTo( String extensionPointId );
  }

  interface ForEachSelector<T> {
    MultiProcessor<T> forEachContributionTo( String extensionPointId );
  }

  interface ExecutableExtensionConfiguration<T> {
    ExecutableExtensionConfiguration<T> withConfiguration( ExecutableExtensionConfigurator<T> configurator );
    ExecutableExtensionConfiguration<T> withExceptionHandler( ExtensionExceptionHandler exceptionHandler );
    ExecutableExtensionConfiguration<T> withTypeAttribute( String typeAttribute);
  }

  public RegistryAdapter() {
    this( Platform.getExtensionRegistry() );
  }

  public RegistryAdapter( IExtensionRegistry registry ) {
    verifyNotNull( registry, "registry" );

    this.factory = new OperatorFactory( registry );
  }

  public ExtensionReader readExtension() {
    return new ExtensionReader( factory.newReadExtensionOperator() );
  }

  public ExtensionsReader readExtensions() {
    return new ExtensionsReader( factory.newReadExtensionsOperator() );
  }
{'fraction_non_alphanumeric': 0.0778382053025153, 'fraction_numerical': 0.0, 'mean_word_length': 5.990498812351544, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5456823', 'n_tokens_mistral': 751, 'n_tokens_neox': 718, 'n_words': 157}