{ throw new BuildException("Required attribute TypeName not specified"); } // 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 mklabel [options...] [viewpath ...] // as specified in the CLEARTOOL help commandLine.setExecutable(getClearToolCommand()); commandLine.createArgument().setValue(COMMAND_MKLABEL); 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 (getReplace()) { // -replace cmd.createArgument().setValue(FLAG_REPLACE); } if (getRecurse()) { // -recurse cmd.createArgument().setValue(FLAG_RECURSE); } if (getVersion() != null) { // -version getVersionCommand(cmd); } if (getComment() != null) { // -c getCommentCommand(cmd); } else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } if (getTypeName() != null) { // type getTypeCommand(cmd);
{ throw new BuildException("Required attribute TypeValue not specified"); } // 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 mkattr [options...] [viewpath ...] // as specified in the CLEARTOOL help commandLine.setExecutable(getClearToolCommand()); commandLine.createArgument().setValue(COMMAND_MKATTR); checkOptions(commandLine); if (!getFailOnErr()) { getProject().log("Ignoring any errors that occur for: " + getViewPathBasename(), Project.MSG_VERBOSE); } // For debugging // System.out.println(commandLine.toString()); 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 (getReplace()) { // -replace cmd.createArgument().setValue(FLAG_REPLACE); } if (getRecurse()) { // -recurse cmd.createArgument().setValue(FLAG_RECURSE); } if (getVersion() != null) { // -version getVersionCommand(cmd); } if (getComment() != null) { // -c getCommentCommand(cmd); } else { if (getCommentFile() != null) { // -cfile getCommentFileCommand(cmd); } else { cmd.createArgument().setValue(FLAG_NOCOMMENT); } } if (getTypeName() != null) { // type getTypeCommand(cmd);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMklabel.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/clearcase/CCMkattr.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
{
1
{
2
            throw new BuildException("Required attribute TypeName not specified");
2
            throw new BuildException("Required attribute TypeValue not specified");
3
        }
3
        }
4
        // Default the viewpath to basedir if it is not specified
4
        // Default the viewpath to basedir if it is not specified
5
        if (getViewPath() == null) {
5
        if (getViewPath() == null) {
6
            setViewPath(aProj.getBaseDir().getPath());
6
            setViewPath(aProj.getBaseDir().getPath());
7
        }
7
        }
8
        // build the command line from what we got. the format is
8
        // build the command line from what we got. the format is
9
        // cleartool mklabel [options...] [viewpath ...]
9
        // cleartool mkattr [options...] [viewpath ...]
10
        // as specified in the CLEARTOOL help
10
        // as specified in the CLEARTOOL help
11
        commandLine.setExecutable(getClearToolCommand());
11
        commandLine.setExecutable(getClearToolCommand());
12
        commandLine.createArgument().setValue(COMMAND_MKLABEL);
12
        commandLine.createArgument().setValue(COMMAND_MKATTR);
13
        checkOptions(commandLine);
13
        checkOptions(commandLine);
14
        if (!getFailOnErr()) {
14
        if (!getFailOnErr()) {
15
            getProject().log("Ignoring any errors that occur for: "
15
            getProject().log("Ignoring any errors that occur for: "
16
                    + getViewPathBasename(), Project.MSG_VERBOSE);
16
                    + getViewPathBasename(), Project.MSG_VERBOSE);
17
        }
17
        }
18
        // For debugging
19
        // System.out.println(commandLine.toString());
18
        result = run(commandLine);
20
        result = run(commandLine);
19
        if (Execute.isFailure(result) && getFailOnErr()) {
21
        if (Execute.isFailure(result) && getFailOnErr()) {
20
            String msg = "Failed executing: " + commandLine.toString();
22
            String msg = "Failed executing: " + commandLine.toString();
21
            throw new BuildException(msg, getLocation());
23
            throw new BuildException(msg, getLocation());
22
        }
24
        }
23
    }
25
    }
24
    /**
26
    /**
25
     * Check the command line options.
27
     * Check the command line options.
26
     */
28
     */
27
    private void checkOptions(Commandline cmd) {
29
    private void checkOptions(Commandline cmd) {
28
        if (getReplace()) {
30
        if (getReplace()) {
29
            // -replace
31
            // -replace
30
            cmd.createArgument().setValue(FLAG_REPLACE);
32
            cmd.createArgument().setValue(FLAG_REPLACE);
31
        }
33
        }
32
        if (getRecurse()) {
34
        if (getRecurse()) {
33
            // -recurse
35
            // -recurse
34
            cmd.createArgument().setValue(FLAG_RECURSE);
36
            cmd.createArgument().setValue(FLAG_RECURSE);
35
        }
37
        }
36
        if (getVersion() != null) {
38
        if (getVersion() != null) {
37
            // -version
39
            // -version
38
            getVersionCommand(cmd);
40
            getVersionCommand(cmd);
39
        }
41
        }
40
        if (getComment() != null) {
42
        if (getComment() != null) {
41
            // -c
43
            // -c
42
            getCommentCommand(cmd);
44
            getCommentCommand(cmd);
43
        } else {
45
        } else {
44
            if (getCommentFile() != null) {
46
            if (getCommentFile() != null) {
45
                // -cfile
47
                // -cfile
46
                getCommentFileCommand(cmd);
48
                getCommentFileCommand(cmd);
47
            } else {
49
            } else {
48
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
50
                cmd.createArgument().setValue(FLAG_NOCOMMENT);
49
            }
51
            }
50
        }
52
        }
51
        if (getTypeName() != null) {
53
        if (getTypeName() != null) {
52
            // type
54
            // type
53
            getTypeCommand(cmd);
55
            getTypeCommand(cmd);
54
        
56
        
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