void execute() throws BuildException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // Default the viewpath to basedir if it is not specified if (getViewPath() == null) { setViewPath(aProj.getBaseDir().getPath()); } // build the command line from what we got. the format is // cleartool checkin [options...] [viewpath ...] // as specified in the CLEARTOOL.EXE help commandLine.setExecutable(getClearToolCommand()); commandLine.createArgument().setValue(COMMAND_CHECKIN); checkOptions(commandLine); if (!getFailOnErr()) { getProject().log("Ignoring any errors that occur for: " + getViewPathBasename(), Project.MSG_VERBOSE); } result = run(commandLine); if (Execute.isFailure(result) && getFailOnErr()) { String msg = "Failed executing: " + commandLine.toString(); throw new BuildException(msg, getLocation()); } } /** * Check the command line options. */ private void checkOptions(Commandline cmd) { if (getComment() != null) { // -c getCommentCommand(cmd); } else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } if (getNoWarn()) { // -nwarn cmd.createArgument().setValue(FLAG_NOWARN);
void execute() throws BuildException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // Default the viewpath to basedir if it is not specified if (getViewPath() == null) { setViewPath(aProj.getBaseDir().getPath()); } // build the command line from what we got. the format is // cleartool checkin [options...] [viewpath ...] // as specified in the CLEARTOOL.EXE help commandLine.setExecutable(getClearToolCommand()); commandLine.createArgument().setValue(COMMAND_MKBL); checkOptions(commandLine); if (!getFailOnErr()) { getProject().log("Ignoring any errors that occur for: " + getBaselineRootName(), Project.MSG_VERBOSE); } result = run(commandLine); if (Execute.isFailure(result) && getFailOnErr()) { String msg = "Failed executing: " + commandLine.toString(); throw new BuildException(msg, getLocation()); } } /** * Check the command line options. */ private void checkOptions(Commandline cmd) { if (getComment() != null) { // -c getCommentCommand(cmd); } else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } if (getIdentical()) { // -identical cmd.createArgument().setValue(FLAG_IDENTICAL);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCCheckin.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMkbl.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void execute() throws BuildException {
1
void execute() throws BuildException {
2
        Commandline commandLine = new Commandline();
2
        Commandline commandLine = new Commandline();
3
        Project aProj = getProject();
3
        Project aProj = getProject();
4
        int result = 0;
4
        int result = 0;
5
        // Default the viewpath to basedir if it is not specified
5
        // Default the viewpath to basedir if it is not specified
6
        if (getViewPath() == null) {
6
        if (getViewPath() == null) {
7
            setViewPath(aProj.getBaseDir().getPath());
7
            setViewPath(aProj.getBaseDir().getPath());
8
        }
8
        }
9
        // build the command line from what we got. the format is
9
        // build the command line from what we got. the format is
10
        // cleartool checkin [options...] [viewpath ...]
10
        // cleartool checkin [options...] [viewpath ...]
11
        // as specified in the CLEARTOOL.EXE help
11
        // as specified in the CLEARTOOL.EXE help
12
        commandLine.setExecutable(getClearToolCommand());
12
        commandLine.setExecutable(getClearToolCommand());
13
        commandLine.createArgument().setValue(COMMAND_CHECKIN);
13
        commandLine.createArgument().setValue(COMMAND_MKBL);
14
        checkOptions(commandLine);
14
        checkOptions(commandLine);
15
        if (!getFailOnErr()) {
15
        if (!getFailOnErr()) {
16
            getProject().log("Ignoring any errors that occur for: "
16
            getProject().log("Ignoring any errors that occur for: "
17
                    + getViewPathBasename(), Project.MSG_VERBOSE);
17
                    + getBaselineRootName(), Project.MSG_VERBOSE);
18
        }
18
        }
19
        result = run(commandLine);
19
        result = run(commandLine);
20
        if (Execute.isFailure(result) && getFailOnErr()) {
20
        if (Execute.isFailure(result) && getFailOnErr()) {
21
            String msg = "Failed executing: " + commandLine.toString();
21
            String msg = "Failed executing: " + commandLine.toString();
22
            throw new BuildException(msg, getLocation());
22
            throw new BuildException(msg, getLocation());
23
        }
23
        }
24
    }
24
    }
25
    /**
25
    /**
26
     * Check the command line options.
26
     * Check the command line options.
27
     */
27
     */
28
    private void checkOptions(Commandline cmd) {
28
    private void checkOptions(Commandline cmd) {
29
        if (getComment() != null) {
29
        if (getComment() != null) {
30
            // -c
30
            // -c
31
            getCommentCommand(cmd);
31
            getCommentCommand(cmd);
32
        } else {
32
        } else {
33
            if (getCommentFile() != null) {
33
            if (getCommentFile() != null) {
34
                // -cfile
34
                // -cfile
35
                getCommentFileCommand(cmd);
35
                getCommentFileCommand(cmd);
36
            } else {
36
            } else {
37
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
37
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
38
            }
38
            }
39
        }
39
        }
40
        if (getNoWarn()) {
40
        if (getIdentical()) {
41
            // -nwarn
41
            // -identical
42
            cmd.createArgument().setValue(FLAG_NOWARN);
42
            cmd.createArgument().setValue(FLAG_IDENTICAL);
43
        
43
        
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