while (iter.hasNext()) { HTTPSamplerBase newUrl = (HTTPSamplerBase) iter.next(); newUrl.setMethod(HTTPConstants.POST); if (log.isDebugEnabled()) { log.debug("Potential Form match: " + newUrl.toString()); } if (HtmlParsingUtils.isAnchorMatched(newUrl, config)) { log.debug("Matched!"); potentialLinks.add(newUrl); } }
HTTPSamplerBase newUrl = HtmlParsingUtils.createUrlFromAnchor( hrefStr, new URL(result.getURL(), base)); newUrl.setMethod(HTTPConstants.GET); if (log.isDebugEnabled()) { log.debug("Potential <frame src> match: " + newUrl); } if (HtmlParsingUtils.isAnchorMatched(newUrl, config)) { log.debug("Matched!"); potentialLinks.add(newUrl); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java
Method name: void addFormUrls(Document, HTTPSampleResult, HTTPSamplerBase, List) Method name: void addFramesetUrls(Document, HTTPSampleResult, HTTPSamplerBase, List)
Number of AST nodes: 8 Number of AST nodes: 7
1
while (iter.hasNext()) {
2
			HTTPSamplerBase newUrl = (HTTPSamplerBase) iter.next();
3
			
1
HTTPSamplerBase newUrl = HtmlParsingUtils.createUrlFromAnchor(
2
                       hrefStr, new URL(result.getURL(), base));
4
newUrl.setMethod(HTTPConstants.POST);
3
               newUrl.setMethod(HTTPConstants.GET);
5
			if (log.isDebugEnabled()) {
4
               if (log.isDebugEnabled()) {
6
			    log.debug("Potential Form match: " + newUrl.toString());
5
                   log.debug("Potential <frame src> match: " + newUrl
7
			}
8
			
6
);
7
               }
9
if (HtmlParsingUtils.isAnchorMatched(newUrl, config)) {
8
               if (HtmlParsingUtils.isAnchorMatched(newUrl, config)) {
10
				log.debug("Matched!");
9
                   log.debug("Matched!");
11
				potentialLinks.add(newUrl);
10
                   potentialLinks.add(newUrl);
12
			}
13
		}
11
               }
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 declared in the same class
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    HTTPSamplerBase newUrl = (HTTPSamplerBase)iter.next();
    7
    HTTPSamplerBase newUrl = (HTTPSamplerBase)iter.next();
    14
    HTTPSamplerBase newUrl = HtmlParsingUtils.createUrlFromAnchor(hrefStr, new URL(result.getURL(), base));
    Differences
    Expression1Expression2Difference
    (HTTPSamplerBase)iter.next()HtmlParsingUtils.createUrlFromAnchor(hrefStr,new URL(result.getURL(),base))TYPE_COMPATIBLE_REPLACEMENT
    14
    HTTPSamplerBase newUrl = HtmlParsingUtils.createUrlFromAnchor(hrefStr, new URL(result.getURL(), base));
    8
    newUrl.setMethod(HTTPConstants.POST);
    8
    newUrl.setMethod(HTTPConstants.POST);
    15
    newUrl.setMethod(HTTPConstants.GET);
    Differences
    Expression1Expression2Difference
    POSTGETVARIABLE_NAME_MISMATCH
    15
    newUrl.setMethod(HTTPConstants.GET);
    9
    if (log.isDebugEnabled())
    16
    if (log.isDebugEnabled())
    10
    log.debug("Potential Form match: " + newUrl.toString());
    10
    log.debug("Potential Form match: " + newUrl.toString());
    Preondition Violations
    Unmatched statement log.debug("Potential Form match: " + newUrl.toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                            
                                                                                                                    
    17
    log.debug("Potential <frame src> match: " + newUrl);
    Preondition Violations
    Unmatched statement log.debug("Potential <frame src> match: " + newUrl); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    17
    log.debug("Potential <frame src> match: " + newUrl);
    11
    if (HtmlParsingUtils.isAnchorMatched(newUrl, config))
    18
    if (HtmlParsingUtils.isAnchorMatched(newUrl, config))
    12
    log.debug("Matched!");
    19
    log.debug("Matched!");
    13
    potentialLinks.add(newUrl);
    20
    potentialLinks.add(newUrl);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement log.debug("Potential Form match: " + newUrl.toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement log.debug("Potential <frame src> match: " + newUrl); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted