CPD Results

The following document contains the results of PMD's CPD

Duplications

FileLine
be/m8n/struts/view/hierarchy/NodeView.java127
be/m8n/struts/view/NodeView.java142
	}

	public boolean equals(Object o) {
		boolean equal = false;
		if (o instanceof NodeView) {
			NodeView nv = (NodeView) o;
			if (nv.getId() == id) equal = true;
		}
		return equal;
	}
	
	private StringBuffer getSpaces(int number) {
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i <= number; i++) {
			sb.append(" ");
		}
		return sb;
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("[(");
		sb.append(getDepth());
		sb.append(")[");
		sb.append(getSpaces(depth));
		sb.append("]");
		if (isParent()) {
			if (isOpen()) {
				sb.append(" v ");
			} else {
				sb.append(" > ");
			}
		}
		sb.append(name);
		sb.append(" (");
		sb.append(description);
		sb.append(")");
		if (isTop()) sb.append("[top]");
		if (isBottom()) sb.append("[bottom]");
		sb.append("]");
		return sb.toString();
	}
	
}

FileLine
be/m8n/struts/view/hierarchy/NodeView.java52
be/m8n/struts/view/NodeView.java59
		setEditable(editable);
	}

	public boolean isBottom() {
		return bottom;
	}

	public void setBottom(boolean bottom) {
		this.bottom = bottom;
	}

	public boolean isParent() {
		return parent;
	}

	public void setParent(boolean parent) {
		this.parent = parent;
	}

	public boolean isClosed() {
		return closed;
	}

	public void setClosed(boolean closed) {
		this.closed = closed;
		this.open = !closed;
	}

	public int getDepth() {
		return depth;
	}

	public void setDepth(int depth) {
		this.depth = depth;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isOpen() {
		return open;
	}

	public void setOpen(boolean open) {
		this.open = open;
		this.closed = !open;
	}

	public boolean isTop() {
		return top;
	}

	public void setTop(boolean top) {
		this.top = top;
	}
	
	public boolean isEditable() {

FileLine
be/m8n/struts/form/RegisterForm.java20
be/m8n/struts/form/RolesForm.java16
    private String password;

    /** Second password property */
    private String passwordTwo;

    /** The username property */
    private String username;

    /** First name property */
    private String firstName;

    /** Last name property */
    private String lastName;

    /** The email address of this registrant. This is an optional property. */
    private String email;

    /**
     * Method reset
     * 
     * @param mapping
     * @param request
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        password = "";
        passwordTwo = "";
        username = "";
        firstName = "";
        lastName = "";
        email = "";
    }

    /**
     * Returns the first password.
     * @return String
     */
    public String getPassword() {
        return password;
    }

    /**
     * Set the first password.
     * @param password
     *            The password to set
     */
    public void setPassword(String passwordOne) {
        this.password = passwordOne;
    }

    /**
     * @return Returns the passwordTwo.
     */
    public String getPasswordTwo() {
        return passwordTwo;
    }

    /**
     * @param passwordTwo
     *            The passwordTwo to set.
     */
    public void setPasswordTwo(String passwordTwo) {
        this.passwordTwo = passwordTwo;
    }

    /**
     * Returns the username.
     * 
     * @return String
     */
    public String getUsername() {
        return username;
    }

    /**
     * Set the username.
     * 
     * @param username
     *            The username to set
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * @return Returns the email.
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email
     *            The email to set.
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return Returns the firstName.
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * @param firstName
     *            The firstName to set.
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     * @return Returns the lastName.
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * @param lastName
     *            The lastName to set.
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     * @return This form as a <tt>String</tt>.
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return "[firstName=" + firstName + ", lastName=" + lastName
                + ", username=" + username + ", password=<hidden>, email="
                + email + ']';
    }

}

FileLine
be/m8n/struts/form/RegisterForm.java50
be/m8n/struts/form/UserForm.java92
	}

	/**
	 * Returns the first password.
	 * 
	 * @return String
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * Set the first password.
	 * 
	 * @param password
	 *            The password to set
	 */
	public void setPassword(String passwordOne) {
		this.password = passwordOne;
	}

	/**
	 * @return Returns the passwordTwo.
	 */
	public String getPasswordTwo() {
		return passwordTwo;
	}

	/**
	 * @param passwordTwo
	 *            The passwordTwo to set.
	 */
	public void setPasswordTwo(String passwordTwo) {
		this.passwordTwo = passwordTwo;
	}

	/**
	 * Returns the username.
	 * 
	 * @return String
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * Set the username.
	 * 
	 * @param username
	 *            The username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return Returns the email.
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email
	 *            The email to set.
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * @return Returns the firstName.
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param firstName
	 *            The firstName to set.
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return Returns the lastName.
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * @param lastName
	 *            The lastName to set.
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * 
	 * @return
	 */
	public String[] getAddRoles() {

FileLine
be/m8n/struts/action/EditUserAction.java70
be/m8n/struts/action/GetUserAction.java53
		String string = request.getParameter("user");

		// get the user
		User user = null;
		if (string != null) {
			Integer id = null;
			try {
				id = new Integer(string);
			} catch (NumberFormatException nfe) {
				log.warn("Invalid user id specified!");
				return mapping.findForward("failure");
			}
			UserDAO userDAO = new UserDAO();
			try {
				user = userDAO.getUser(id, true);
				if (user == null) {
					log.warn("User with id " + id + " not found!");
					return mapping.findForward("failure");
				}
				log.info("User with id " + id + " found: " + user);

FileLine
be/m8n/struts/action/EditUserAction.java54
be/m8n/struts/action/RemoveUserAction.java32
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {

		Enumeration enumeration = request.getAttributeNames();
		while (enumeration.hasMoreElements()) {
			String name = (String) enumeration.nextElement();
			log.debug("attribute: " + name + "=" + request.getAttribute(name));
		}

		enumeration = request.getParameterNames();
		while (enumeration.hasMoreElements()) {
			String name = (String) enumeration.nextElement();
			log.debug("parameter: " + name + "=" + request.getParameter(name));
		}