if(channel != null) { try { channel.close(); } catch(IOException iex) { log.debug("Error closing channel",iex); } }
while (iter.hasNext()) { try { set.add(iter.next()); } catch (Exception err) { log.error("", err); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/AjpSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/ActionRouter.java
Method name: void threadFinished() Method name: Set getAction(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
if(channel != null) {
2
            try {
3
            channel.close();
4
            
1
while (iter.hasNext()) {
2
			try {
3
				set.add(iter.next());
5
} catch(IOException iex) {
4
			} catch (Exception err) {
6
            log.debug("Error closing channel",iex);
7
            }
8
        
5
				log.error("", err);
6
			}
9
}
7
		}
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.3
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    5
    try
    Differences
    Expression1Expression2Difference
    java.io.IOExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    iexerrVARIABLE_NAME_MISMATCH
    java.io.IOExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    debugerrorMETHOD_INVOCATION_NAME_MISMATCH
    "Error closing channel"""LITERAL_VALUE_MISMATCH
    iexerrVARIABLE_NAME_MISMATCH
    java.io.IOExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression log.debug("Error closing channel",iex) is a void method call, and thus it cannot be parameterized
    Expression log.error("",err) is a void method call, and thus it cannot be parameterized
    5
    try
    3
    channel.close();
    3
    channel.close();
    Preondition Violations
    Unmatched statement channel.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
                                          
                                                    
    6
    set.add(iter.next());
    Precondition Violations (3)
    Row Violation
    1Expression log.debug("Error closing channel",iex) is a void method call, and thus it cannot be parameterized
    2Expression log.error("",err) is a void method call, and thus it cannot be parameterized
    3Unmatched statement channel.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