if (allMessagesButton.isSelected()) { someMessagesField.setEnabled(false); }
if (log.isDebugEnabled()) { log.debug("Reusing the HttpClient: @"+System.identityHashCode(httpClient)); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java
Method name: void stateChanged(ChangeEvent) Method name: HttpClient setupConnection(URL, HttpMethodBase, HTTPSampleResult)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (allMessagesButton.isSelected()) {
1
if (
2
					someMessagesField.setEnabled(false);
3
				
2
log.isDebugEnabled()) {
3
                log.debug("Reusing the HttpClient: @"+System.identityHashCode(httpClient));
4
}
4
            }
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.2
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (allMessagesButton.isSelected())
    1
    if (allMessagesButton.isSelected())
    31
    if (log.isDebugEnabled())
    Differences
    Expression1Expression2Difference
    isSelectedisDebugEnabledMETHOD_INVOCATION_NAME_MISMATCH
    allMessagesButtonlogVARIABLE_NAME_MISMATCH
    javax.swing.JRadioButtonorg.apache.log.LoggerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.swing.JRadioButton of variable allMessagesButton does not match with type org.apache.log.Logger of variable log
    • Make classes javax.swing.JRadioButton and org.apache.log.Logger extend a common superclass
    31
    if (log.isDebugEnabled())
    2
    someMessagesField.setEnabled(false);
    2
    someMessagesField.setEnabled(false);
    32
    log.debug("Reusing the HttpClient: @" + System.identityHashCode(httpClient));
    Differences
    Expression1Expression2Difference
    false"Reusing the HttpClient: @" + System.identityHashCode(httpClient)AST_TYPE_MISMATCH
    setEnableddebugMETHOD_INVOCATION_NAME_MISMATCH
    someMessagesFieldlogVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldorg.apache.log.LoggerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression log.debug("Reusing the HttpClient: @" + System.identityHashCode(httpClient)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression someMessagesField.setEnabled(false) is a void method call, and thus it cannot be parameterized
    Expression log.debug("Reusing the HttpClient: @" + System.identityHashCode(httpClient)) is a void method call, and thus it cannot be parameterized
    Type javax.swing.JTextField of variable someMessagesField does not match with type org.apache.log.Logger of variable log
    • Make classes javax.swing.JTextField and org.apache.log.Logger extend a common superclass
    32
    log.debug("Reusing the HttpClient: @" + System.identityHashCode(httpClient));
    Precondition Violations (6)
    Row Violation
    1Type javax.swing.JRadioButton of variable allMessagesButton does not match with type org.apache.log.Logger of variable log
    2Expression log.debug("Reusing the HttpClient: @" + System.identityHashCode(httpClient)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression someMessagesField.setEnabled(false) is a void method call, and thus it cannot be parameterized
    4Expression log.debug("Reusing the HttpClient: @" + System.identityHashCode(httpClient)) is a void method call, and thus it cannot be parameterized
    5Type javax.swing.JTextField of variable someMessagesField does not match with type org.apache.log.Logger of variable log
    6The refactoring of the clones is infeasible, because classes and org.apache.jmeter.protocol.http.sampler.HTTPSampler2 do not have a common superclass