if (host == null || host.length() == 0) { // it's not set, lets check if the user passed // proxy host and port from command line host = System.getProperty("http.proxyHost"); if (host != null) { this.setProxyHost(host); } }
for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) { String fileName = (String)newRecentFiles.get(i); if(fileName != null) { setRecentFile(i, fileName); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/LoadRecentProject.java
Method name: void checkProxy() Method name: void updateRecentFileMenuItems(List, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (host == null || host.length() == 0) {
2
				// it's not set, lets check if the user passed
3
				// proxy host and port from command line
4
                host = System.getProperty("http.proxyHost");
5
				if (host != null) {
6
					this.setProxyHost(host);
7
				}
8
			
1
for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
2
            String fileName = (String)newRecentFiles.get(i);
3
            if(fileName != null) {
4
                setRecentFile(i, fileName);
5
            }
9
}
6
        }
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 comparisons6
  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)26.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    host = System.getProperty("http.proxyHost");
                                                                                              
                                                                                                        
    12
    String fileName = (String)newRecentFiles.get(i);
    Preondition Violations
    Unmatched statement String fileName=(String)newRecentFiles.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12
    String fileName = (String)newRecentFiles.get(i);
    7
    if (host != null)
    7
    if (host != null)
    13
    if (fileName != null)
    Differences
    Expression1Expression2Difference
    hostfileNameVARIABLE_NAME_MISMATCH
    13
    if (fileName != null)
    8
    this.setProxyHost(host);
    8
    this.setProxyHost(host);
    14
    setRecentFile(i, fileName);
    Differences
    Expression1Expression2Difference
    setProxyHostsetRecentFileMETHOD_INVOCATION_NAME_MISMATCH
    this.setProxyHost(host)setRecentFile(i,fileName)ARGUMENT_NUMBER_MISMATCH
    thisMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression this.setProxyHost(host) is a void method call, and thus it cannot be parameterized
    Expression setRecentFile(i,fileName) is a void method call, and thus it cannot be parameterized
    Expression this.setProxyHost(host) is a void method call, and thus it cannot be parameterized
    Expression setRecentFile(i,fileName) is a void method call, and thus it cannot be parameterized
    14
    setRecentFile(i, fileName);
    Precondition Violations (5)
    Row Violation
    1Unmatched statement String fileName=(String)newRecentFiles.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression this.setProxyHost(host) is a void method call, and thus it cannot be parameterized
    3Expression setRecentFile(i,fileName) is a void method call, and thus it cannot be parameterized
    4Expression this.setProxyHost(host) is a void method call, and thus it cannot be parameterized
    5Expression setRecentFile(i,fileName) is a void method call, and thus it cannot be parameterized