else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } // viewpath cmd.createArgument().setValue(getViewPath()); // Print out info about the notco option // System.out.println( "Notco: " + (getNotco() ? "yes" : "no") ); } /** * If true, checks out the file as reserved. * * @param reserved the status to set the flag to */ public void setReserved(boolean reserved) { mReserved = reserved; } /** * Get reserved flag status * * @return boolean containing status of reserved flag */ public boolean getReserved() { return mReserved; } /** * If true, checkout fails if the element is already checked out to the current view. * * @param notco the status to set the flag to * @since ant 1.6.1 */ public void setNotco(boolean notco) { mNotco = notco; } /** * Get notco flag status * * @return boolean containing status of notco flag * @since ant 1.6.1 */ public boolean getNotco() { return mNotco; } /** * Creates a writable file under a different filename. * * @param outf the path to the out file */ public void setOut(String outf) { mOut = outf; } /** * Get out file * * @return String containing the path to the out file */ public String getOut() { return mOut; } /** * If true, checks out the file but does not create an * editable file containing its data. * * @param ndata the status to set the flag to */ public void setNoData(boolean ndata) { mNdata = ndata; } /** * Get nodata flag status * * @return boolean containing status of ndata flag */ public boolean getNoData() { return mNdata; } /** * Specify a branch to check out the file to. * * @param branch the name of the branch */ public void setBranch(String branch) { mBranch = branch; } /** * Get branch name * * @return String containing the name of the branch */ public String getBranch() { return mBranch; } /** * If true, allows checkout of a version other than main latest. * * @param version the status to set the flag to */ public void setVersion(boolean version) { mVersion = version; } /** * Get version flag status * * @return boolean containing status of version flag */ public boolean getVersion() { return mVersion; } /** * If true, warning messages are suppressed. * * @param nwarn the status to set the flag to */ public void setNoWarn(boolean nwarn) { mNwarn = nwarn; } /** * Get nowarn flag status * * @return boolean containing status of nwarn flag */ public boolean getNoWarn() { return mNwarn; } /** * Sets the comment string. * * @param comment the comment string */ public void setComment(String comment) { mComment = comment; } /** * Get comment string * * @return String containing the comment */ public String getComment() { return mComment; } /** * Specifies a file containing a comment. * * @param cfile the path to the comment file */ public void setCommentFile(String cfile) { mCfile = cfile; } /** * Get comment file * * @return String containing the path to the comment file */ public String getCommentFile() { return mCfile; } /** * Get the 'out' command * * @param cmd containing the command line string with or * without the out flag and path appended */ private void getOutCommand(Commandline cmd) { if (getOut() != null) { /* 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_OUT); cmd.createArgument().setValue(getOut()); } }
else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } // type-name@vob cmd.createArgument().setValue(getTypeSpecifier()); } /** * Set type-name string * * @param tn the type-name string */ public void setTypeName(String tn) { mTypeName = tn; } /** * Get type-name string * * @return String containing the type-name */ public String getTypeName() { return mTypeName; } /** * Set the VOB name * * @param vob the VOB name */ public void setVOB(String vob) { mVOB = vob; } /** * Get VOB name * * @return String containing VOB name */ public String getVOB() { return mVOB; } /** * Set the replace flag * * @param repl the status to set the flag to */ public void setReplace(boolean repl) { mReplace = repl; } /** * Get replace flag status * * @return boolean containing status of replace flag */ public boolean getReplace() { return mReplace; } /** * Set the global flag * * @param glob the status to set the flag to */ public void setGlobal(boolean glob) { mGlobal = glob; } /** * Get global flag status * * @return boolean containing status of global flag */ public boolean getGlobal() { return mGlobal; } /** * Set the ordinary flag * * @param ordinary the status to set the flag to */ public void setOrdinary(boolean ordinary) { mOrdinary = ordinary; } /** * Get ordinary flag status * * @return boolean containing status of ordinary flag */ public boolean getOrdinary() { return mOrdinary; } /** * Set the pbranch flag * * @param pbranch the status to set the flag to */ public void setPbranch(boolean pbranch) { mPbranch = pbranch; } /** * Get pbranch flag status * * @return boolean containing status of pbranch flag */ public boolean getPbranch() { return mPbranch; } /** * Set the shared flag * * @param shared the status to set the flag to */ public void setShared(boolean shared) { mShared = shared; } /** * Get shared flag status * * @return boolean containing status of shared flag */ public boolean getShared() { return mShared; } /** * Set comment string * * @param comment the comment string */ public void setComment(String comment) { mComment = comment; } /** * Get comment string * * @return String containing the comment */ public String getComment() { return mComment; } /** * Set comment file * * @param cfile the path to the comment file */ public void setCommentFile(String cfile) { mCfile = cfile; } /** * Get comment file * * @return String containing the path to the comment file */ public String getCommentFile() { return mCfile; } /** * Get the 'comment' command * * @param cmd containing the command line string with or * without the comment flag and string appended */ private void getCommentCommand(Commandline cmd) { if (getComment() != null) { /* 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()); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckout.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklbtype.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
else {
1
else {
2
            if (getCommentFile() != null) {
2
            if (getCommentFile() != null) {
3
                // -cfile
3
                // -cfile
4
                getCommentFileCommand(cmd);
4
                getCommentFileCommand(cmd);
5
            } else {
5
            } else {
6
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
6
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
7
            }
7
            }
8
        }
8
        }
9
        // viewpath
9
        // type-name@vob
10
        cmd.createArgument().setValue(getViewPath());
10
        cmd.createArgument().setValue(get
11
        // Print out info about the notco option
12
        // System.out.println( "Notco: " + (getNotco() ? "yes" : "no") );
11
TypeSpecifier());
13
    }
12
    }
14
    /**
13
    /**
15
     * If true, checks out the file as reserved.
14
     * Set type-name string
16
     *
15
     *
17
     * @param reserved the status to set the flag to
16
     * @param tn the type-name string
18
     */
17
     */
19
    public void setReserved(boolean reserved) {
18
    public void set
20
        mReserved = reserved
19
TypeName(String tn) {
21
;
20
        mTypeName = tn;
22
    }
21
    }
23
    /**
22
    /**
24
     * Get reserved flag status
23
     * Get type-name string
25
     *
24
     *
26
     * @return boolean containing status of reserved flag
25
     * @return String containing the type-name
27
     */
26
     */
28
    public boolean getReserved() {
27
    public String getTypeName() {
29
        return mReserved;
28
        return mTypeName;
30
    }
29
    }
31
    /**
30
    /**
32
     * If true, checkout fails if the element is already checked out to the current view.
31
     * 
33
     *
34
     * @param notco the status to set the flag to
35
     * @since ant 1.6.1
32
Set the VOB name
33
     *
34
     * @param vob the VOB name
36
     */
35
     */
37
    public void setNotco(boolean notco) {
36
    public void setVOB(String vob) {
38
        mNotco = notco;
37
        mVOB = vob;
39
    }
38
    }
40
    /**
39
    /**
41
     * Get notco flag status
40
     * Get VOB name
42
     *
41
     *
43
     * @return boolean containing status of notco flag
42
     * @return String containing 
44
     * @since ant 1.6.1
43
VOB name
45
     */
44
     */
46
    public boolean getNotco() {
45
    public String getVOB() {
47
        return mNotco;
46
        return mVOB;
48
    }
47
    }
49
    /**
48
    /**
50
     * Creates a writable file under a different filename.
49
     * Set the replace flag
51
     *
50
     *
52
     * @param outf the path to the out file
51
     * @param repl the status to set the flag to
53
     */
52
     */
54
    public void setOut(String outf) {
53
    public void set
55
        mOut = outf
54
Replace(boolean repl) {
56
;
55
        mReplace = repl;
57
    }
56
    }
58
    /**
57
    /**
59
     * Get out file
58
     * Get replace flag status
60
     *
59
     *
61
     * @return String containing the path to the out file
60
     * @return boolean containing status of replace flag
62
     */
61
     */
63
    public String getOut() {
62
    public boolean getReplace() {
64
        return mOut;
63
        return mReplace;
65
    }
64
    }
66
    /**
65
    /**
67
     * If true, checks out the file but does not create an
66
     * 
68
     * editable file containing its data.
67
Set the global flag
69
     *
68
     *
70
     * @param ndata the status to set the flag to
69
     * @param glob the status to set the flag to
71
     */
70
     */
72
    public void setNoData(boolean ndata) {
71
    public void setGlobal(boolean glob) {
73
        mNdata = ndata;
72
        mGlobal = glob;
74
    }
73
    }
75
    /**
74
    /**
76
     * Get nodata flag status
75
     * Get global flag status
77
     *
76
     *
78
     * @return boolean containing status of ndata flag
77
     * @return boolean containing status of global flag
79
     */
78
     */
80
    public boolean getNoData() {
79
    public boolean getGlobal() {
81
        return mNdata;
80
        return mGlobal;
82
    }
81
    }
83
    /**
82
    /**
84
     * Specify a branch to check out the file to.
83
     * Set the ordinary flag
85
     *
84
     *
86
     * @param branch the name of the branch
85
     * @param ordinary the status to set the flag to
87
     */
86
     */
88
    public void setBranch(String branch) {
87
    public void setOrdinary(boolean ordinary) {
89
        mBranch = branch;
88
        mOrdinary = ordinary;
90
    }
89
    }
91
    /**
90
    /**
92
     * Get branch name
91
     * Get ordinary flag status
93
     *
92
     *
94
     * @return String containing the name of the branch
93
     * @return boolean containing status of ordinary flag
95
     */
94
     */
96
    public String getBranch() {
95
    public boolean getOrdinary() {
97
        return mBranch;
96
        return mOrdinary;
98
    }
97
    }
99
    /**
98
    /**
100
     * If true, allows checkout of a version other than main latest.
99
     * Set the pbranch flag
101
     *
100
     *
102
     * @param version the status to set the flag to
101
     * @param pbranch the status to set the flag to
103
     */
102
     */
104
    public void setVersion(boolean version) {
103
    public void setPbranch(boolean pbranch) {
105
        mVersion = version;
104
        mPbranch = pbranch;
106
    }
105
    }
107
    /**
106
    /**
108
     * Get version flag status
107
     * Get pbranch flag status
109
     *
108
     *
110
     * @return boolean containing status of version flag
109
     * @return boolean containing status of pbranch flag
111
     */
110
     */
112
    public boolean getVersion() {
111
    public boolean getPbranch() {
113
        return mVersion;
112
        return mPbranch;
114
    }
113
    }
115
    /**
114
    /**
116
     * If true, warning messages are suppressed.
115
     * Set the shared flag
117
     *
116
     *
118
     * @param nwarn the status to set the flag to
117
     * @param shared the status to set the flag to
119
     */
118
     */
120
    public void setNoWarn(boolean nwarn) {
119
    public void setShared(boolean shared) {
121
        mNwarn = nwarn;
120
        mShared = shared;
122
    }
121
    }
123
    /**
122
    /**
124
     * Get nowarn flag status
123
     * Get shared flag status
125
     *
124
     *
126
     * @return boolean containing status of nwarn flag
125
     * @return boolean containing status of shared flag
127
     */
126
     */
128
    public boolean getNoWarn() {
127
    public boolean getShared() {
129
        return mNwarn;
128
        return mShared;
130
    }
129
    }
131
    /**
130
    /**
132
     * Sets the comment string.
131
     * Set comment string
133
     *
132
     *
134
     * @param comment the comment string
133
     * @param comment the comment string
135
     */
134
     */
136
    public void setComment(String comment) {
135
    public void setComment(String comment) {
137
        mComment = comment;
136
        mComment = comment;
138
    }
137
    }
139
    /**
138
    /**
140
     * Get comment string
139
     * Get comment string
141
     *
140
     *
142
     * @return String containing the comment
141
     * @return String containing the comment
143
     */
142
     */
144
    public String getComment() {
143
    public String getComment() {
145
        return mComment;
144
        return mComment;
146
    }
145
    }
147
    /**
146
    /**
148
     * Specifies a file containing a comment.
147
     * Set comment file
149
     *
148
     *
150
     * @param cfile the path to the comment file
149
     * @param cfile the path to the comment file
151
     */
150
     */
152
    public void setCommentFile(String cfile) {
151
    public void setCommentFile(String cfile) {
153
        mCfile = cfile;
152
        mCfile = cfile;
154
    }
153
    }
155
    /**
154
    /**
156
     * Get comment file
155
     * Get comment file
157
     *
156
     *
158
     * @return String containing the path to the comment file
157
     * @return String containing the path to the comment file
159
     */
158
     */
160
    public String getCommentFile() {
159
    public String getCommentFile() {
161
        return mCfile;
160
        return mCfile;
162
    }
161
    }
163
    /**
162
    /**
164
     * Get the 'out' command
163
     * Get the 'comment' command
165
     *
164
     *
166
     * @param cmd containing the command line string with or
165
     * @param cmd containing the command line string with or
167
     *                    without the out flag and path appended
166
     *        without the comment flag and string appended
168
     */
167
     */
169
    private void getOutCommand(Commandline cmd) {
168
    private void getCommentCommand(Commandline cmd) {
170
        if (getOut() != null) {
169
        if (getComment() != null) {
171
            /* Had to make two separate commands here because if a space is
170
            /* Had to make two separate commands here because if a space is
172
               inserted between the flag and the value, it is treated as a
171
               inserted between the flag and the value, it is treated as a
173
               Windows filename with a space and it is enclosed in double
172
               Windows filename with a space and it is enclosed in double
174
               quotes ("). This breaks clearcase.
173
               quotes ("). This breaks clearcase.
175
            */
174
            */
176
            cmd.createArgument().setValue(FLAG_OUT);
175
            cmd.createArgument().setValue(FLAG_COMMENT);
177
            cmd.createArgument().setValue(getOut());
176
            cmd.createArgument().setValue(getComment());
178
        }
177
        }
179
    }
178
    }
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