if (running) { // Pass request to new proxy thread Proxy thd = (Proxy) proxyClass.newInstance(); thd.configure(clientSocket, target, pageEncodings, formEncodings); thd.start(); }
infinite.setSelected(false); loops.setEnabled(true); loops.setText(Integer.toString(loopCount));
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/Daemon.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/LoopControlPanel.java
Method name: void run() Method name: void setState(int)
Number of AST nodes: 4 Number of AST nodes: 3
1
if (running) {
1
i
2
						// Pass request to new proxy thread
3
						Proxy thd = (Proxy) proxyClass.newInstance();
4
                        thd.configure(clientSocket, target, pageEncodings, formEncodings);
5
						thd.start();
6
					}
2
nfinite.setSelected(false);
3
			loops.setEnabled(true);
4
			loops.setText(Integer.toString(loopCount));
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.0
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                  
    5
    infinite.setSelected(false);
    14
    Proxy thd = (Proxy)proxyClass.newInstance();
    14
    Proxy thd = (Proxy)proxyClass.newInstance();
    Preondition Violations
    Unmatched statement Proxy thd=(Proxy)proxyClass.newInstance(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    15
    thd.configure(clientSocket, target, pageEncodings, formEncodings);
    15
    thd.configure(clientSocket, target, pageEncodings, formEncodings);
    6
    loops.setEnabled(true);
    Differences
    Expression1Expression2Difference
    configuresetEnabledMETHOD_INVOCATION_NAME_MISMATCH
    thdloopsVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.proxy.Proxyjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    thd.configure(clientSocket,target,pageEncodings,formEncodings)loops.setEnabled(true)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression thd.configure(clientSocket,target,pageEncodings,formEncodings) is a void method call, and thus it cannot be parameterized
    Expression loops.setEnabled(true) is a void method call, and thus it cannot be parameterized
    Expression thd.configure(clientSocket,target,pageEncodings,formEncodings) is a void method call, and thus it cannot be parameterized
    Expression loops.setEnabled(true) is a void method call, and thus it cannot be parameterized
    6
    loops.setEnabled(true);
    16
    thd.start();
    16
    thd.start();
    7
    loops.setText(Integer.toString(loopCount));
    Differences
    Expression1Expression2Difference
    startsetTextMETHOD_INVOCATION_NAME_MISMATCH
    thdloopsVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.proxy.Proxyjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    thd.start()loops.setText(Integer.toString(loopCount))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression thd.start() is a void method call, and thus it cannot be parameterized
    Expression loops.setText(Integer.toString(loopCount)) is a void method call, and thus it cannot be parameterized
    Expression thd.start() is a void method call, and thus it cannot be parameterized
    Expression loops.setText(Integer.toString(loopCount)) is a void method call, and thus it cannot be parameterized
    7
    loops.setText(Integer.toString(loopCount));
    Precondition Violations (9)
    Row Violation
    1Unmatched statement Proxy thd=(Proxy)proxyClass.newInstance(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression thd.configure(clientSocket,target,pageEncodings,formEncodings) is a void method call, and thus it cannot be parameterized
    3Expression loops.setEnabled(true) is a void method call, and thus it cannot be parameterized
    4Expression thd.configure(clientSocket,target,pageEncodings,formEncodings) is a void method call, and thus it cannot be parameterized
    5Expression loops.setEnabled(true) is a void method call, and thus it cannot be parameterized
    6Expression thd.start() is a void method call, and thus it cannot be parameterized
    7Expression loops.setText(Integer.toString(loopCount)) is a void method call, and thus it cannot be parameterized
    8Expression thd.start() is a void method call, and thus it cannot be parameterized
    9Expression loops.setText(Integer.toString(loopCount)) is a void method call, and thus it cannot be parameterized