<commit_before>package jwebform.integration;

import java.util.function.BiConsumer;
import jwebform.FormResult;
import jwebform.env.Env;
import jwebform.env.EnvBuilder;
import jwebform.env.Request;
import jwebform.env.SessionGet;
import jwebform.env.SessionSet;
import jwebform.integration.bean2form.FormResultWithBean;
import jwebform.processor.FormGenerator;

// Container, that holds a jWebForm Form (or a normal bean) and provides a facade to jwebform
// objects
// typically this will be filled by the framework
public class FormRunner {
  private final Env env;
  private final BiConsumer<String, Object> model;
  private final FormRunnerConfig formRunnerConfig;
  private final InternalFormRunner formRunner = new InternalFormRunner();

  public FormRunner(Request request, SessionGet sessionGet, SessionSet sessionSet,
      BiConsumer<String, Object> model, FormRunnerConfig formRunnerConfig) {
    this.env = new EnvBuilder().of(request, sessionGet, sessionSet);
    this.model = model;
    this.formRunnerConfig = formRunnerConfig;
  }

  public FormResultWithBean runWithBean(Object bean) {
    return formRunner.runWithBean(bean, env, model, formRunnerConfig);
  }

  public FormResult runWitFormGenerator(FormGenerator formGenerator) {
    return formRunner.runWithBFormGenerator(formGenerator, env, model, formRunnerConfig);
  }


  @Deprecated // Use either runWithBean or runWithFormGenerator
  public FormResult run(Object formOrBean) {
    return formRunner.run(formOrBean, env, model, formRunnerConfig);
  }


}<commit_msg>Cleanup<commit_after>package jwebform.integration;

import java.util.function.BiConsumer;
import jwebform.FormResult;
import jwebform.env.Env;
import jwebform.env.EnvBuilder;
import jwebform.env.Request;
import jwebform.env.SessionGet;
import jwebform.env.SessionSet;
import jwebform.integration.bean2form.FormResultWithBean;
import jwebform.processor.FormGenerator;

// Container, that holds a jWebForm Form (or a normal bean) and provides a facade to jwebform
// objects
// typically this will be filled by the framework
public class FormRunner {
  private final Env env;
  private final BiConsumer<String, Object> model;
  private final FormRunnerConfig formRunnerConfig;
  private final InternalFormRunner internalFormRunner = new InternalFormRunner();

  public FormRunner(Request request, SessionGet sessionGet, SessionSet sessionSet,
      BiConsumer<String, Object> model, FormRunnerConfig formRunnerConfig) {
    this.env = new EnvBuilder().of(request, sessionGet, sessionSet);
    this.model = model;
    this.formRunnerConfig = formRunnerConfig;
  }

  public FormResultWithBean runWithBean(Object bean) {
    return internalFormRunner.runWithBean(bean, env, model, formRunnerConfig);
  }

  public FormResult runWitFormGenerator(FormGenerator formGenerator) {
    return internalFormRunner.runWithBFormGenerator(formGenerator, env, model, formRunnerConfig);
  }


  @Deprecated // Use either runWithBean or runWithFormGenerator
  public FormResult run(Object formOrBean) {
    return internalFormRunner.run(formOrBean, env, model, formRunnerConfig);
  }


}
{'fraction_non_alphanumeric': 0.07519280205655526, 'fraction_numerical': 0.0006426735218508997, 'mean_word_length': 5.526205450733753, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7152053', 'n_tokens_mistral': 874, 'n_tokens_neox': 854, 'n_words': 242}