File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java | |||
Method name: void waitForString(String, Integer)
|
Method name: void waitForString(String, Integer)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | while (sb.toString().indexOf(s) == -1) {↵ | |||
2 | while (Calendar.getInstance().before(endTime)↵ | 1 | while (Calendar.getInstance().before(endTime)↵ | |
3 | && is.available() == 0) {↵ | 2 | && is.available() == 0) {↵ | |
4 | Thread.sleep(250);↵ | 3 | Thread.sleep(250);↵ | |
5 | }↵ | 4 | }↵ | |
6 | if (is.available() == 0) {↵ | 5 | if (is.available() == 0) {↵ | |
6 | log("Read before running into timeout: "↵ | |||
7 | + sb.toString(), Project.MSG_DEBUG);↵ | |||
7 | throw new BuildException(↵ | 8 | throw new BuildException(↵ | |
8 | "Response timed-out waiting for \"" + s + '\"',↵ | 9 | "Response timed-out waiting for \"" + s + '\"',↵ | |
9 | getLocation());↵ | 10 | getLocation());↵ | |
10 | }↵ | 11 | }↵ | |
11 | sb.append((char) is.read());↵ | 12 |
| |
12 | } | |||
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 19 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
10 | while (Calendar.getInstance().before(endTime) && is.available() == 0) | 10 | while (Calendar.getInstance().before(endTime) && is.available() == 0) | ||||
11 | Thread.sleep(250); | 11 | Thread.sleep(250); | ||||
12 | if (is.available() == 0) | 12 | if (is.available() == 0) | ||||
|
| 13 | log("Read before running into timeout: " + sb.toString(), Project.MSG_DEBUG); | ||||
13 | throw new BuildException("Response timed-out waiting for \"" + s + '\"', getLocation()); | 14 | throw new BuildException("Response timed-out waiting for \"" + s + '\"', getLocation()); | ||||
14 | sb.append((char)is.read()); | 15 | sb.append((char)is.read()); |
Row | Violation |
---|---|
1 | Unmatched statement log("Read before running into timeout: " + sb.toString(),Project.MSG_DEBUG); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |