int actualCount = 0; String line = null; try { // read one line at a time using // BufferedReader 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(); } if (line == null) { breader.close(); breader = null; this.READER = null; // this.READER = new BufferedReader(new // FileReader(this.SOURCE)); // parse(this.READER,el); } } catch (IOException ioe) { log.error("Error reading log file", ioe); } return actualCount;
int actualCount = 0; String line = null; try { // read one line at a time using // BufferedReader line = breader.readLine(FILENAME); 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); } if (line == null) { breader.closeFile(FILENAME); // this.READER = new BufferedReader(new // FileReader(this.SOURCE)); // parse(this.READER,el); } } catch (IOException ioe) { log.error("Error reading log file", ioe); } return actualCount;
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: 15 Number of AST nodes: 13
1
int actualCount = 0;
1
int actualCount = 0;
2
		String line = null;
2
		String line = null;
3
		try {
3
		try {
4
			// read one line at a time using
4
			// read one line at a time using
5
			// BufferedReader
5
			// BufferedReader
6
			line = breader.readLine();
6
			line = breader.readLine(FILENAME);
7
			while (line != null) {
7
			while (line != null) {
8
				if (line.length() > 0) {
8
				if (line.length() > 0) {
9
					actualCount += this.parseLine(line, el);
9
					actualCount += this.parseLine(line, el);
10
				}
10
				}
11
				// we check the count to see if we have exceeded
11
				// we check the count to see if we have exceeded
12
				// the number of lines to parse. There's no way
12
				// the number of lines to parse. There's no way
13
				// to know where to stop in the file. Therefore
13
				// to know where to stop in the file. Therefore
14
				// we use break to escape the while loop when
14
				// we use break to escape the while loop when
15
				// we've reached the count.
15
				// we've reached the count.
16
				if (parseCount != -1 && actualCount >= parseCount) {
16
				if (parseCount != -1 && actualCount >= parseCount) {
17
					break;
17
					break;
18
				}
18
				}
19
				line = breader.readLine();
19
				line = breader.readLine(FILENAME);
20
			}
20
			}
21
			if (line == null) {
21
			if (line == null) {
22
				breader.close();
22
				breader.close
23
				breader = null;
24
				this.READER = null;
23
File(FILENAME);
25
				// this.READER = new BufferedReader(new
24
				// this.READER = new BufferedReader(new
26
				// FileReader(this.SOURCE));
25
				// FileReader(this.SOURCE));
27
				// parse(this.READER,el);
26
				// parse(this.READER,el);
28
			}
27
			}
29
		} catch (IOException ioe) {
28
		} catch (IOException ioe) {
30
			log.error("Error reading log file", ioe);
29
			log.error("Error reading log file", ioe);
31
		}
30
		}
32
		return actualCount;
31
		return actualCount;
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.8
Clones locationClones are in different classes having the same super class
Number of node comparisons38
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)22.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    int actualCount = 0;
    1
    int actualCount = 0;
    2
    String line = null;
    2
    String line = null;
    3
    try
    3
    try
                                                                          
    4
    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
    4
    line = breader.readLine(FILENAME);
    4
    line = breader.readLine();
    4
    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
                                                          
    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
                                                            
    11
    if (line == null)
    11
    if (line == null)
                                                                    
    12
    breader.closeFile(FILENAME);
    Preondition Violations
    Unmatched statement breader.closeFile(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
    12
    breader.closeFile(FILENAME);
    12
    breader.close();
    12
    breader.close();
    Preondition Violations
    Unmatched statement breader.close(); 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
                                            
    13
    breader = null;
                                      
    14
    this.READER = null;
                                              
    15
    return actualCount;
    13
    return actualCount;
    Precondition Violations (10)
    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
    5Unmatched 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
    6Unmatched 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
    7Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched 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
    9Unmatched statement breader.closeFile(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
    10Unmatched statement breader.close(); 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