File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/sos/SOSTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/sos/SOSTest.java | |||
Method name: void testLabelFlags()
|
Method name: void testCheckinProjectFlags()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | String[] sTestCmdLine = {"soscmd", "-command", "AddLabel", "-server",↵ | 1 | String[] sTestCmdLine = {"soscmd", "-command", "↵ | |
2 | ↵ | 2 | CheckInProject",↵ | |
3 | SOS_SERVER_PATH, "-name", SOS_USERNAME,↵ | 3 | "-recursive", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME,↵ | |
4 | "-password", "", "-database",↵ | 4 | "-password", "", "-database",↵ | |
5 | VSS_SERVER_PATH, "-project",↵ | 5 | VSS_SERVER_PATH, "-project",↵ | |
6 | DS_VSS_PROJECT_PATH, "-label",↵ | 6 | DS_VSS_PROJECT_PATH, "↵ | |
7 | SRC_LABEL, "-verbose"↵ | 7 | ", "", "-soshome", SOS_HOME, "-workdir",↵ | |
8 | , "-log", SRC_COMMENT};↵ | 8 | project.getBaseDir().getAbsolutePath(), "-log", SRC_COMMENT,};↵ | |
9 | // Set up a sosCheckout task↵ | 9 | // Set up a SOSCheckin task↵ | |
10 | SOSLabel sosLabel = new SOSLabel();↵ | 10 | SOSCheckin sosCheckin = new SOSCheckin();↵ | |
11 | sosLabel↵ | 11 | sosCheckin.setProject(project);↵ | |
12 | .setVssServerPath(VSS_SERVER_PATH);↵ | 12 | sosCheckin.setVssServerPath(VSS_SERVER_PATH);↵ | |
13 | sosLabel.setSosServerPath(SOS_SERVER_PATH);↵ | 13 | sosCheckin.setSosServerPath(SOS_SERVER_PATH);↵ | |
14 | sosLabel.setProjectPath(DS_VSS_PROJECT_PATH);↵ | 14 | sosCheckin.setProjectPath(DS_VSS_PROJECT_PATH);↵ | |
15 | sosLabel.setUsername(SOS_USERNAME);↵ | 15 | sosCheckin.setComment(SRC_COMMENT);↵ | |
16 | sosLabel.setSosHome(SOS_HOME);↵ | 16 | sosCheckin.setUsername(SOS_USERNAME);↵ | |
17 | sosLabel.setComment(SRC_COMMENT);↵ | 17 | sos↵ | |
18 | sosLabel.setLabel(SRC_LABEL);↵ | |||
19 | sosLabel↵ | 18 | Checkin.setSosHome(SOS_HOME);↵ | |
20 | .setNoCache(true);↵ | 19 | sosCheckin.setNoCache(true);↵ | |
21 | sosLabel.setNoCompress(false);↵ | 20 | sosCheckin.setNoCompress(false);↵ | |
22 | sosLabel.setVerbose(true); | 21 | sosCheckin.setVerbose(false); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 124 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 1 | String[] sTestCmdLine = {"soscmd", "-command", "CheckInProject", "-recursive", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "", "", "-soshome", SOS_HOME, "-workdir", project.getBaseDir().getAbsolutePath(), "-log", SRC_COMMENT}; | ||||||||||||||||||||
1 | String[] sTestCmdLine = {"soscmd", "-command", "AddLabel", "-server", SOS_SERVER_PATH, "-name", SOS_USERNAME, "-password", "", "-database", VSS_SERVER_PATH, "-project", DS_VSS_PROJECT_PATH, "-label", SRC_LABEL, "-verbose", "-log", SRC_COMMENT}; | | |||||||||||||||||||||
2 | SOSLabel sosLabel = new SOSLabel(); |
| 2 | SOSCheckin sosCheckin = new SOSCheckin(); | |||||||||||||||||||
|
| 3 | sosCheckin.setProject(project); | ||||||||||||||||||||
3 | sosLabel.setVssServerPath(VSS_SERVER_PATH); |
| 4 | sosCheckin.setVssServerPath(VSS_SERVER_PATH); | |||||||||||||||||||
4 | sosLabel.setSosServerPath(SOS_SERVER_PATH); |
| 5 | sosCheckin.setSosServerPath(SOS_SERVER_PATH); | |||||||||||||||||||
5 | sosLabel.setProjectPath(DS_VSS_PROJECT_PATH); |
| 6 | sosCheckin.setProjectPath(DS_VSS_PROJECT_PATH); | |||||||||||||||||||
6 | sosLabel.setUsername(SOS_USERNAME); |
| 8 | sosCheckin.setUsername(SOS_USERNAME); | |||||||||||||||||||
7 | sosLabel.setSosHome(SOS_HOME); |
| 9 | sosCheckin.setSosHome(SOS_HOME); | |||||||||||||||||||
8 | sosLabel.setComment(SRC_COMMENT); |
| 7 | sosCheckin.setComment(SRC_COMMENT); | |||||||||||||||||||
9 | sosLabel.setLabel(SRC_LABEL); |
| | ||||||||||||||||||||
10 | sosLabel.setNoCache(true); |
| 10 | sosCheckin.setNoCache(true); | |||||||||||||||||||
11 | sosLabel.setNoCompress(false); |
| 11 | sosCheckin.setNoCompress(false); | |||||||||||||||||||
12 | sosLabel.setVerbose(true); |
| 12 | sosCheckin.setVerbose(false); |
Row | Violation |
---|---|
1 | Unmatched statement String[] sTestCmdLine={"soscmd","-command","CheckInProject","-recursive","-server",SOS_SERVER_PATH,"-name",SOS_USERNAME,"-password","","-database",VSS_SERVER_PATH,"-project",DS_VSS_PROJECT_PATH,"","","-soshome",SOS_HOME,"-workdir",project.getBaseDir().getAbsolutePath(),"-log",SRC_COMMENT}; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement sosCheckin.setProject(project); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression sosLabel cannot be unified with expression sosCheckin , because common superclass org.apache.tools.ant.taskdefs.optional.sos.SOS does not declare member(s) public void setComment(java.lang.String) |
4 | Unmatched statement sosLabel.setLabel(SRC_LABEL); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables sosLabel, sTestCmdLine , while Clone fragment #2 returns variables sosCheckin, sTestCmdLine |