if(selectedFile != null) { boolean merging = e.getActionCommand().equals(ActionNames.MERGE); // We must ask the user if it is ok to close current project if(!merging) { if (!Close.performAction(e)) { return; } } loadProjectFile(e, selectedFile, merging); }
if (port == UNSPECIFIED_PORT) { String prot = getProtocol(); if (PROTOCOL_HTTPS.equalsIgnoreCase(prot)) { return DEFAULT_HTTPS_PORT; } if (!PROTOCOL_HTTP.equalsIgnoreCase(prot)) { log.warn("Unexpected protocol: "+prot); // TODO - should this return something else? } return DEFAULT_HTTP_PORT; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/action/Load.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Method name: void doAction(ActionEvent) Method name: int getPort()
Number of AST nodes: 6 Number of AST nodes: 7
1
if(selectedFile != null) {
1
if
2
            boolean merging = e.getActionCommand().equals(ActionNames.MERGE);
3
            // We must ask the user if it is ok to close current project
4
            if(!merging) {
5
				if (!Close.performAction(e)) {
6
				    return;
7
				}
8
            }
9
            loadProjectFile(e, selectedFile, merging);
10
        
2
 (port == UNSPECIFIED_PORT) {
3
			String prot = getProtocol();
4
            if (PROTOCOL_HTTPS.equalsIgnoreCase(prot)) {
5
				return DEFAULT_HTTPS_PORT;
6
			}
7
            if (!PROTOCOL_HTTP.equalsIgnoreCase(prot)) {
8
                log.warn("Unexpected protocol: "+prot);
9
                // TODO - should this return something else?
10
            }
11
			return DEFAULT_HTTP_PORT;
11
}
12
		}
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 comparisons6
  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 fragment2
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                              
    3
    String prot = getProtocol();
    8
    if (!Close.performAction(e))
    8
    if (!Close.performAction(e))
    4
    if (PROTOCOL_HTTPS.equalsIgnoreCase(prot))
    Differences
    Expression1Expression2Difference
    !Close.performAction(e)PROTOCOL_HTTPS.equalsIgnoreCase(prot)TYPE_COMPATIBLE_REPLACEMENT
    4
    if (PROTOCOL_HTTPS.equalsIgnoreCase(prot))
                                                              
    5
    return DEFAULT_HTTPS_PORT;
    Preondition Violations
    Unmatched return DEFAULT_HTTPS_PORT;
    5
    return DEFAULT_HTTPS_PORT;
    9
    return;
    9
    return;
    Preondition Violations
    Unmatched return;
                        
    Precondition Violations (2)
    Row Violation
    1Unmatched return DEFAULT_HTTPS_PORT;
    2Unmatched return;