public class CvsUser { /** The user's Id */ private String userID; /** The user's full name */ private String displayName; /** * Set the user's fullname * * @param displayName the user's full name */ public void setDisplayname(final String displayName) { this.displayName = displayName; } /** * Set the user's id * * @param userID the user's new id value. */ public void setUserid(final String userID) { this.userID = userID; } /** * Get the user's id. * * @return The userID value */ public String getUserID() { return userID; } /** * Get the user's full name * * @return the user's full name */ public String getDisplayname() { return displayName; } /** * Validate that this object is configured. * * @exception BuildException if the instance has not be correctly * configured. */ public void validate() throws BuildException { if (null == userID) { final String message = "Username attribute must be set."; throw new BuildException(message); } if (null == displayName) { final String message = "Displayname attribute must be set for userID " + userID; throw new BuildException(message);
public class ExtraAttribute { private String name; private String value; /** * Set the name of the parameter. * * @param name the name of parameter */ public void setName(final String name) { this.name = name; } /** * Set the value of the parameter. * * @param value the parameter value */ public void setValue(final String value) { this.value = value; } /** * Retrieve name of parameter. * * @return the name of parameter. */ String getName() { return name; } /** * Retrieve the value of parameter. * * @return the value of parameter. */ String getValue() { return value; } /** * Make sure that neither the name or the value * is null. * * @throws BuildException if the attribute is invalid. */ public void validate() throws BuildException { if (null == name) { final String message = "Missing name from parameter."; throw new BuildException(message); } else if (null == value) { final String message = "Missing value from parameter " + name + "."; throw new BuildException(message);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/cvslib/CvsUser.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/ExtraAttribute.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class CvsUser {
1
public class 
2
    /** The user's Id */
3
    private String userID;
4
    /** The user's full
2
ExtraAttribute {
5
 name */
3
    private String name;
6
    private String displayName;
4
    private String value;
7
    /**
5
    /**
8
     * Set the user's fullname
6
     * Set the name of the parameter.
9
     *
7
     *
10
     * @param displayName the user's full name
8
     * @param name the name of parameter
11
     */
9
     */
12
    public void setDisplayname(final String displayName) {
10
    public void setName(final String name) {
13
        this.displayName = displayName;
11
        this.name = name;
14
    }
12
    }
15
    /**
13
    /**
16
     * Set the user's id
14
     * Set the 
17
     *
18
     * @param userID the user's new id
15
value of the parameter.
16
     *
19
 value.
17
     * @param value the parameter value
20
     */
18
     */
21
    public void setUserid(final String userID) {
19
    public void setValue(final String value) {
22
        this.userID = userID;
20
        this.value = value;
23
    }
21
    }
24
    /**
22
    /**
25
     * Get the user's id.
23
     * Retrieve name of parameter.
26
     *
24
     *
27
     * @return The userID value
25
     * @return the name of parameter.
28
     */
26
     */
29
    public String getUserID() {
27
    String getName() {
30
        return userID;
28
        return name;
31
    }
29
    }
32
    /**
30
    /**
33
     * Get the user's full name
31
     * Retrieve the value of parameter.
34
     *
32
     *
35
     * @return the user's full name
33
     * @return the value of parameter.
36
     */
34
     */
37
    public String getDisplayname() {
35
    String getValue() {
38
        return displayName;
36
        return value;
39
    }
37
    }
40
    /**
38
    /**
41
     * Validate that this object is configured
39
     * Make sure that neither the name or the value
42
.
40
     * is null.
43
     *
41
     *
44
     * @exception BuildException if the instance has not be correctly
42
     * @throws BuildException if the 
45
     *            configured.
43
attribute is invalid.
46
     */
44
     */
47
    public void validate() throws BuildException {
45
    public void validate() throws BuildException {
48
        if (null == userID) {
46
        if (null == name) {
49
            final String message = "Username attribute must be set.";
47
            final String message = "Missing name from parameter.";
50
            throw new BuildException(message);
48
            throw new BuildException(message);
51
        }
49
        }
52
        if (null == displayName) {
50
 else if (null == value) {
53
            final String message =
51
            final String message =
54
                "Displayname attribute must be set for userID " + userID;
52
 "Mis
53
sing value from parameter " + name + ".";
55
            throw new BuildException(message);
54
            throw new BuildException(message);
56
        
55
        
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0