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