if (javaClient == null) { log.debug(whoAmI() + "Creating Java Client"); createJavaClient(); javaClient.setupTest(context); }
if (line == null) { breader.close(); breader = null; this.READER = null; // this.READER = new BufferedReader(new // FileReader(this.SOURCE)); // parse(this.READER,el); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/java/sampler/JavaSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java
Method name: SampleResult sample(Entry) Method name: int parse(BufferedReader, TestElement, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (javaClient == null) {
1
if (line == null) {
2
			log.debug(whoAmI() + "Creating Java Client");
2
			
3
			createJavaClient();
4
			javaClient.setupTest(context
3
	breader.close();
4
				breader = null;
5
				this.READER = null;
6
				// this.READER = new BufferedReader(new
7
				// FileReader(this.SOURCE));
5
);
8
				// parse(this.READER,el);
6
		}
9
			}
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.1
Clones locationClones are in different classes
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (javaClient == null)
    4
    if (javaClient == null)
    11
    if (line == null)
    Differences
    Expression1Expression2Difference
    javaClientlineVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.java.sampler.JavaSamplerClientjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.protocol.java.sampler.JavaSamplerClient of variable javaClient does not match with type java.lang.String of variable line
    • Make classes org.apache.jmeter.protocol.java.sampler.JavaSamplerClient and java.lang.String extend a common superclass
    11
    if (line == null)
    5
    log.debug(whoAmI() + "Creating Java Client");
                                                                                                    
    6
    createJavaClient();
                                                
    7
    javaClient.setupTest(context);
                                                                      
                                            
    12
    breader.close();
                                      
    13
    breader = null;
                                              
    14
    this.READER = null;
    Precondition Violations (1)
    Row Violation
    1Type org.apache.jmeter.protocol.java.sampler.JavaSamplerClient of variable javaClient does not match with type java.lang.String of variable line