<commit_before>/* DO NOT EDIT: File is auto-generated */
package <%= to_package(repository.imit.qualified_change_listener_name) %>;

public class <%= repository.imit.change_listener_name %>
{
  @javax.persistence.PostUpdate
  @javax.persistence.PostPersist
  public void postUpdate( final Object object )
  {
    if ( !getRegistry().getRollbackOnly() )
    {
      getRecorder().recordEntityMessageForEntity( object, true );
    }
  }

  /**
   * Collect messages before they are committed to the database with the
   * assumption that the remove will not fail. This allows us to traverse
   * the object graph before it is deleted. Note: This is a different strategy
   * from postUpdate() but PostUpdate may be changed in the future to match
   * remove hook. (Compare Pre versus Post hooks)
   *
   * @param object the entity removed.
   */
  @javax.persistence.PreRemove
  public void preRemove( final Object object )
  {
    if ( !getRegistry().getRollbackOnly() )
    {
      getRecorder().recordEntityMessageForEntity( object, false );
    }
  }

  /** Standard JNDI key for BeanManager. */
  private static final String BEAN_MANAGER_KEY = "java:comp/BeanManager";

  /*
   * The registry and recorder are actually accessed via JNDI. The @Resource/@Inject annotations is ignored in production as JPA 2.0 does not
   * support it. However our Guice based test infrastructure uses it to populate and avoid instantiation of JNDI
   * resources.
   */
  @javax.annotation.Resource
  private javax.transaction.TransactionSynchronizationRegistry _registry;
  @javax.inject.Inject
  private <%= repository.imit.qualified_change_recorder_name %> _recorder;

  @java.lang.SuppressWarnings( "unchecked" )
  private static <T> T lookup( final String key )<commit_msg>Remove unused constant<commit_after>/* DO NOT EDIT: File is auto-generated */
package <%= to_package(repository.imit.qualified_change_listener_name) %>;

public class <%= repository.imit.change_listener_name %>
{
  @javax.persistence.PostUpdate
  @javax.persistence.PostPersist
  public void postUpdate( final Object object )
  {
    if ( !getRegistry().getRollbackOnly() )
    {
      getRecorder().recordEntityMessageForEntity( object, true );
    }
  }

  /**
   * Collect messages before they are committed to the database with the
   * assumption that the remove will not fail. This allows us to traverse
   * the object graph before it is deleted. Note: This is a different strategy
   * from postUpdate() but PostUpdate may be changed in the future to match
   * remove hook. (Compare Pre versus Post hooks)
   *
   * @param object the entity removed.
   */
  @javax.persistence.PreRemove
  public void preRemove( final Object object )
  {
    if ( !getRegistry().getRollbackOnly() )
    {
      getRecorder().recordEntityMessageForEntity( object, false );
    }
  }

  /*
   * The registry and recorder are actually accessed via JNDI. The @Resource/@Inject annotations is ignored in production as JPA 2.0 does not
   * support it. However our Guice based test infrastructure uses it to populate and avoid instantiation of JNDI
   * resources.
   */
  @javax.annotation.Resource
  private javax.transaction.TransactionSynchronizationRegistry _registry;
  @javax.inject.Inject
  private <%= repository.imit.qualified_change_recorder_name %> _recorder;

  @java.lang.SuppressWarnings( "unchecked" )
  private static <T> T lookup( final String key )
{'fraction_non_alphanumeric': 0.08665105386416862, 'fraction_numerical': 0.00117096018735363, 'mean_word_length': 3.7991573033707864, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2553391', 'n_tokens_mistral': 957, 'n_tokens_neox': 940, 'n_words': 321}