CPD Results

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

Duplications

FileLine
org/cid/distribution/plugins/db/QueryDataComponent.java50
org/cid/distribution/plugins/list/DBMemberManagerComponent.java91
	public DBMemberManagerComponent() {
		// It is important to call the parent's constructor
		super();
	}

	/**
	 * Configures additional rules for the commons-digester library.
	 */
	public static void addRules(Digester d, String patternPrefix) {
		DistributionComponentBase.addRules(d, patternPrefix);
		d.addCallMethod (patternPrefix + "/query", "setQuery", 0);
    d.addCallMethod (patternPrefix + "/connectionProvider", "setConnectionProvider", 0);
	}
	
	/**
	 * Initializes the ConnectionComponent. 
	 * @see org.cid.distribution.base.DistributionComponentBase#init()
	 */
	@Override
	public void init() throws DistributionProcessingException, DistributionConfigurationException {
		super.init();	
		
		// Get the reference to the data connection
		connection = this.getConnectionProvider().getConnection();

FileLine
org/cid/distribution/plugins/db/QueryDataComponent.java121
org/cid/distribution/plugins/list/DBMemberManagerComponent.java189
		PreparedStatement statement = null;
		ResultSet resultSet = null;

		logger.trace("Querying database: " + sqlQuery);

		try {
			statement = connection.prepareStatement(sqlQuery);
		} catch (SQLException e) {
			throw new DistributionProcessingException("Could not prepare the query: "	+ sqlQuery, e);
		}

		try {
			resultSet = statement.executeQuery();
		} catch (SQLException e) {
			throw new DistributionProcessingException("Could not execute the query: " + sqlQuery, e);
		}

		return new DataToMemberEnumeration(new ResultSetToDataEnumeration(resultSet), COLUMN_NAME, COLUMN_ADDRESS);

FileLine
org/cid/distribution/plugins/mail/MailEditorHandler.java93
org/cid/distribution/plugins/mail/MailWriterHandler.java88
		DistributionMail m = this.getMail();
		if (m == null) {
			throw new DistributionProcessingException("A MailEditorHandled could not get the DistributionMail object from the message properties.");
		}
		if (! (m instanceof DistributionMail)) {
			throw new DistributionProcessingException ("A MailEditorHandler could not edit a message becaus it was not a DistributionMail (it was " + message.getClass() + ")"); 
		}

FileLine
org/cid/distribution/plugins/mail/POP3Handler.java235
org/cid/distribution/plugins/mail/SMTPHandler.java237
	}	
	
	/**
	 * Returns the SMTP host (evaluated).
	 * @return The SMTP host (evaluated).
	 */
	public String getHost() {
		return distributionContext.evaluate(host);
	}

	/**
	 * Sets the SMTP host to use by this OutputChannel.
	 * @param host The SMTP host to use by this OutputChannel.
	 */
	public void setHost(String host) {
		this.host = host;
	}

	/**
	 * Returns the password used to open the SMTP connection (evaluated).
	 * @return The password used to open the SMTP connection (evaluated).
	 */
	public String getPassword() {
		return distributionContext.evaluate(password);