CPD Results

The following document contains the results of PMD's CPD 5.6.1.

Duplications

File Line
org/mybatis/guice/datasource/dbcp/PerUserPoolDataSourceProvider.java 30
org/mybatis/guice/datasource/dbcp/SharedPoolDataSourceProvider.java 28
  private final PerUserPoolDataSource dataSource = new PerUserPoolDataSource();

  @com.google.inject.Inject(optional = true)
  public void setConnectionPoolDataSource(ConnectionPoolDataSource cpds) {
    dataSource.setConnectionPoolDataSource(cpds);
  }

  @com.google.inject.Inject(optional = true)
  public void setDataSourceName(@Named("DBCP.name") String name) {
    dataSource.setDataSourceName(name);
  }

  @com.google.inject.Inject(optional = true)
  public void setDefaultAutoCommit(@Named("JDBC.autoCommit") boolean autoCommit) {
    dataSource.setDefaultAutoCommit(autoCommit);
  }

  @com.google.inject.Inject(optional = true)
  public void setDefaultReadOnly(@Named("DBCP.defaultReadOnly") boolean defaultReadOnly) {
    dataSource.setDefaultReadOnly(defaultReadOnly);
  }

  @com.google.inject.Inject(optional = true)
  public void setDefaultTransactionIsolation(
      @Named("DBCP.defaultTransactionIsolation") int defaultTransactionIsolation) {
    dataSource.setDefaultTransactionIsolation(defaultTransactionIsolation);
  }

  @com.google.inject.Inject(optional = true)
  public void setDescription(@Named("DBCP.description") String description) {
    dataSource.setDescription(description);
  }

  @com.google.inject.Inject(optional = true)
  public void setJndiEnvironment(@Named("DBCP.jndi.key") String key, @Named("DBCP.jndi.value") String value) {
    dataSource.setJndiEnvironment(key, value);
  }

  @com.google.inject.Inject(optional = true)
  public void setLoginTimeout(@Named("JDBC.loginTimeout") int loginTimeout) {
    dataSource.setLoginTimeout(loginTimeout);
  }

  @com.google.inject.Inject(optional = true)
  public void setMinEvictableIdleTimeMillis(@Named("DBCP.minEvictableIdleTimeMillis") int minEvictableIdleTimeMillis) {
    dataSource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
  }

  @com.google.inject.Inject(optional = true)
  public void setNumTestsPerEvictionRun(@Named("DBCP.numTestsPerEvictionRun") int numTestsPerEvictionRun) {
    dataSource.setNumTestsPerEvictionRun(numTestsPerEvictionRun);
  }

  @com.google.inject.Inject(optional = true)
  public void setRollbackAfterValidation(@Named("DBCP.rollbackAfterValidation") boolean rollbackAfterValidation) {
    dataSource.setRollbackAfterValidation(rollbackAfterValidation);
  }

  @com.google.inject.Inject(optional = true)
  public void setTestOnBorrow(@Named("DBCP.testOnBorrow") boolean testOnBorrow) {
    dataSource.setTestOnBorrow(testOnBorrow);
  }

  @com.google.inject.Inject(optional = true)
  public void setTestOnReturn(@Named("DBCP.testOnReturn") boolean testOnReturn) {
    dataSource.setTestOnReturn(testOnReturn);
  }

  @com.google.inject.Inject(optional = true)
  public void setTestWhileIdle(@Named("DBCP.testWhileIdle") boolean testWhileIdle) {
    dataSource.setTestWhileIdle(testWhileIdle);
  }

  @com.google.inject.Inject(optional = true)
  public void setTimeBetweenEvictionRunsMillis(
      @Named("DBCP.timeBetweenEvictionRunsMillis") int timeBetweenEvictionRunsMillis) {
    dataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
  }

  @com.google.inject.Inject(optional = true)
  public void setValidationQuery(@Named("DBCP.validationQuery") String validationQuery) {
    dataSource.setValidationQuery(validationQuery);
  }

  @com.google.inject.Inject(optional = true)
  public void setDefaultMaxActive(@Named("DBCP.maxActive") int maxActive) {
File Line
org/mybatis/guice/datasource/builtin/PooledDataSourceProvider.java 45
org/mybatis/guice/datasource/dbcp/BasicDataSourceProvider.java 50
    dataSource = new PooledDataSource(driverClassLoader, driver, url, null, null);
  }

  /**
   * Sets the user.
   *
   * @param username the new user
   * @since 3.3
   */
  @com.google.inject.Inject(optional = true)
  public void setUser(@Named("JDBC.username") final String username) {
    dataSource.setUsername(username);
  }

  /**
   * Sets the password.
   *
   * @param password the new password
   * @since 3.3
   */
  @com.google.inject.Inject(optional = true)
  public void setPassword(@Named("JDBC.password") final String password) {
    dataSource.setPassword(password);
  }

  /**
   * Sets the auto commit.
   *
   * @param autoCommit the new auto commit
   */
  @com.google.inject.Inject(optional = true)
  public void setAutoCommit(@Named("JDBC.autoCommit") final boolean autoCommit) {
    dataSource.setDefaultAutoCommit(autoCommit);
  }

  /**
   * Sets the login timeout.
   *
   * @param loginTimeout the new login timeout
   */
  @com.google.inject.Inject(optional = true)
  public void setLoginTimeout(@Named("JDBC.loginTimeout") final int loginTimeout) {
File Line
org/mybatis/guice/transactional/XASqlSessionManager.java 225
org/mybatis/guice/transactional/XASqlSessionManager.java 307
      log.debug(id + ": call prepare old state=" + xlatedState() + ", XID=" + xid);
    }

    if (xid == null) {
      throw new MyBatisXAException(id + ": XID cannot be null", XAException.XAER_INVAL);
    }

    if (state == NO_TX) {
      throw new MyBatisXAException(id + ": resource never started on XID " + xid, XAException.XAER_PROTO);
    } else if (state == STARTED) {
      throw new MyBatisXAException(id + ": resource never ended on XID " + xid, XAException.XAER_PROTO);
    } else if (state == ENDED) {
      if (this.xid.equals(xid)) {
        if (log.isDebugEnabled()) {
          log.debug(id + ": OK to prepare, old state=" + xlatedState() + ", XID=" + xid);