while (line != null) { if (line.length() > 0) { actualCount += this.parseLine(line, el); } // we check the count to see if we have exceeded // the number of lines to parse. There's no way // to know where to stop in the file. Therefore // we use break to escape the while loop when // we've reached the count. if (parseCount != -1 && actualCount >= parseCount) { break; } line = breader.readLine(); }
while (line != null) { if (line.length() > 0) { actualCount += this.parseLine(line, el); } // we check the count to see if we have exceeded // the number of lines to parse. There's no way // to know where to stop in the file. Therefore // we use break to escape the while loop when // we've reached the count. if (parseCount != -1 && actualCount >= parseCount) { break; } line = breader.readLine(FILENAME); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/SharedTCLogParser.java
Method name: int parse(BufferedReader, TestElement, int) Method name: int parse(FileServer, TestElement, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
while (line != null) {
1
while (line != null) {
2
				if (line.length() > 0) {
2
				if (line.length() > 0) {
3
					actualCount += this.parseLine(line, el);
3
					actualCount += this.parseLine(line, el);
4
				}
4
				}
5
				// we check the count to see if we have exceeded
5
				// we check the count to see if we have exceeded
6
				// the number of lines to parse. There's no way
6
				// the number of lines to parse. There's no way
7
				// to know where to stop in the file. Therefore
7
				// to know where to stop in the file. Therefore
8
				// we use break to escape the while loop when
8
				// we use break to escape the while loop when
9
				// we've reached the count.
9
				// we've reached the count.
10
				if (parseCount != -1 && actualCount >= parseCount) {
10
				if (parseCount != -1 && actualCount >= parseCount) {
11
					break;
11
					break;
12
				}
12
				}
13
				line = breader.readLine();
13
				line = breader.readLine(FILENAME);
14
			}
14
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are in different classes having the same super class
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)104.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    while (line != null)
    5
    while (line != null)
    6
    if (line.length() > 0)
    6
    if (line.length() > 0)
    7
    actualCount += this.parseLine(line, el);
    7
    actualCount += this.parseLine(line, el);
    8
    if (parseCount != -1 && actualCount >= parseCount)
    8
    if (parseCount != -1 && actualCount >= parseCount)
    9
    break;
    9
    break;
                                                                            
    10
    line = breader.readLine(FILENAME);
    Preondition Violations
    Unmatched statement line=breader.readLine(FILENAME); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement line=breader.readLine(FILENAME); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    10
    line = breader.readLine(FILENAME);
    10
    line = breader.readLine();
    10
    line = breader.readLine();
    Preondition Violations
    Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                            
    Precondition Violations (5)
    Row Violation
    1Unmatched statement line=breader.readLine(FILENAME); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement line=breader.readLine(FILENAME); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Clone fragment #1 returns variables line, actualCount , while Clone fragment #2 returns variables line, actualCount