private void getCommentCommand(Commandline cmd) { if (getComment() == null) { return; } else { /* Had to make two separate commands here because if a space is inserted between the flag and the value, it is treated as a Windows filename with a space and it is enclosed in double quotes ("). This breaks clearcase. */ cmd.createArgument().setValue(FLAG_COMMENT); cmd.createArgument().setValue(getComment()); } } /** * Get the 'pname' command * * @param cmd containing the command line string with or * without the pname flag and value appended */ private void getPnameCommand(Commandline cmd) { if (getPname() == null) { return; } else { /* Had to make two separate commands here because if a space is inserted between the flag and the value, it is treated as a Windows filename with a space and it is enclosed in double quotes ("). This breaks clearcase. */ cmd.createArgument().setValue(FLAG_PNAME); cmd.createArgument().setValue(getPname()); } } /** * Return which object/pname is being operated on * * @return String containing the object/pname being worked on */ private String getOpType() { if (getPname() != null) { return getPname(); } else { return getObjselect(); } } /** * -replace flag -- replace existing lock on object(s) */ public static final String FLAG_REPLACE = "-replace"
private void getCommentCommand(Commandline cmd) { if (getComment() == null) { return; } else { /* Had to make two separate commands here because if a space is inserted between the flag and the value, it is treated as a Windows filename with a space and it is enclosed in double quotes ("). This breaks clearcase. */ cmd.createArgument().setValue(FLAG_COMMENT); cmd.createArgument().setValue(getComment()); } } /** * Get the 'pname' command * * @param cmd containing the command line string with or without the * pname flag and value appended */ private void getPnameCommand(Commandline cmd) { if (getPname() == null) { return; } else { /* Had to make two separate commands here because if a space is inserted between the flag and the value, it is treated as a Windows filename with a space and it is enclosed in double quotes ("). This breaks clearcase. */ cmd.createArgument().setValue(FLAG_PNAME); cmd.createArgument().setValue(getPname()); } } /** * Return which object/pname is being operated on * * @return String containing the object/pname being worked on */ private String getOpType() { if (getPname() != null) { return getPname(); } else { return getObjSelect(); } } /** * -comment flag -- method to use for commenting events */ public static final String FLAG_COMMENT = "-comment"
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCLock.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCUnlock.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
private void getCommentCommand(Commandline cmd) {
1
private void getCommentCommand(Commandline cmd) {
2
        if (getComment() == null) {
2
        if (getComment() == null) {
3
            return;
3
            return;
4
        } else {
4
        } else {
5
            /* Had to make two separate commands here because if a space is
5
            /* Had to make two separate commands here because if a space is
6
               inserted between the flag and the value, it is treated as a
6
               inserted between the flag and the value, it is treated as a
7
               Windows filename with a space and it is enclosed in double
7
               Windows filename with a space and it is enclosed in double
8
               quotes ("). This breaks clearcase.
8
               quotes ("). This breaks clearcase.
9
            */
9
            */
10
            cmd.createArgument().setValue(FLAG_COMMENT);
10
            cmd.createArgument().setValue(FLAG_COMMENT);
11
            cmd.createArgument().setValue(getComment());
11
            cmd.createArgument().setValue(getComment());
12
        }
12
        }
13
    }
13
    }
14
    /**
14
    /**
15
     * Get the 'pname' command
15
     * Get the 'pname' command
16
     *
16
     *
17
     * @param cmd containing the command line string with or
17
     * @param cmd containing the command line string with or without the
18
     *            without the pname flag and value appended
18
     *            pname flag and value appended
19
     */
19
     */
20
    private void getPnameCommand(Commandline cmd) {
20
    private void getPnameCommand(Commandline cmd) {
21
        if (getPname() == null) {
21
        if (getPname() == null) {
22
            return;
22
            return;
23
        } else {
23
        } else {
24
            /* Had to make two separate commands here because if a space is
24
            /* Had to make two separate commands here because if a space is
25
               inserted between the flag and the value, it is treated as a
25
               inserted between the flag and the value, it is treated as a
26
               Windows filename with a space and it is enclosed in double
26
               Windows filename with a space and it is enclosed in double
27
               quotes ("). This breaks clearcase.
27
               quotes ("). This breaks clearcase.
28
            */
28
            */
29
            cmd.createArgument().setValue(FLAG_PNAME);
29
            cmd.createArgument().setValue(FLAG_PNAME);
30
            cmd.createArgument().setValue(getPname());
30
            cmd.createArgument().setValue(getPname());
31
        }
31
        }
32
    }
32
    }
33
    /**
33
    /**
34
     * Return which object/pname is being operated on
34
     * Return which object/pname is being operated on
35
     *
35
     *
36
     * @return String containing the object/pname being worked on
36
     * @return String containing the object/pname being worked on
37
     */
37
     */
38
    private String getOpType() {
38
    private String getOpType() {
39
        if (getPname() != null) {
39
        if (getPname() != null) {
40
            return getPname();
40
            return getPname();
41
        } else {
41
        } else {
42
            return getObjselect();
42
            return getObjSelect();
43
        }
43
        }
44
    }
44
    }
45
    /**
45
    /**
46
     *  -replace flag -- replace existing lock on object(s)
46
     * -comment flag -- method to use for commenting events
47
     */
47
     */
48
    public static final String FLAG_REPLACE = "-replace"
48
    public static final String FLAG_COMMENT = "-comment"
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