String base = ""; NodeList baseList = html.getElementsByTagName("base"); // $NON-NLS-1$ if (baseList.getLength() > 0) { base = baseList.item(0).getAttributes().getNamedItem("href").getNodeValue(); // $NON-NLS-1$ } NodeList nodeList = html.getElementsByTagName("a"); // $NON-NLS-1$ for (int i = 0; i < nodeList.getLength(); i++) { Node tempNode = nodeList.item(i); NamedNodeMap nnm = tempNode.getAttributes(); Node namedItem = nnm.getNamedItem("href"); // $NON-NLS-1$ if (namedItem == null) { continue; } String hrefStr = namedItem.getNodeValue();
String base = ""; NodeList baseList = html.getElementsByTagName("base"); // $NON-NLS-1$ if (baseList.getLength() > 0) { base = baseList.item(0).getAttributes().getNamedItem("href") // $NON-NLS-1$ .getNodeValue(); } NodeList nodeList = html.getElementsByTagName("frame"); // $NON-NLS-1$ for (int i = 0; i < nodeList.getLength(); i++) { Node tempNode = nodeList.item(i); NamedNodeMap nnm = tempNode.getAttributes(); Node namedItem = nnm.getNamedItem("src"); // $NON-NLS-1$ if (namedItem == null) { continue; } String hrefStr = namedItem.getNodeValue();
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 addAnchorUrls(Document, HTTPSampleResult, HTTPSamplerBase, List) Method name: void addFramesetUrls(Document, HTTPSampleResult, HTTPSamplerBase, List)
Number of AST nodes: 11 Number of AST nodes: 11
1
String base = "";
1
String base = "";
2
		NodeList baseList = html.getElementsByTagName("base"); // $NON-NLS-1$
2
       NodeList baseList = html.getElementsByTagName("base"); // $NON-NLS-1$
3
		if (baseList.getLength() > 0) {
3
       if (baseList.getLength() > 0) {
4
			base = baseList.item(0).getAttributes().getNamedItem("href").getNodeValue(); // $NON-NLS-1$
4
           base = baseList.item(0).getAttributes().getNamedItem("href")
5
		}
6
		
5
 // $NON-NLS-1$
6
                   .getNodeValue();
7
       }
7
NodeList nodeList = html.getElementsByTagName("a"); // $NON-NLS-1$
8
       NodeList nodeList = html.getElementsByTagName("frame"); // $NON-NLS-1$
8
		for (int i = 0; i < nodeList.getLength(); i++) {
9
       for (int i = 0; i < nodeList.getLength(); i++) {
9
			Node tempNode = nodeList.item(i);
10
           Node tempNode = nodeList.item(i);
10
			NamedNodeMap nnm = tempNode.getAttributes();
11
           NamedNodeMap nnm = tempNode.getAttributes();
11
			Node namedItem = nnm.getNamedItem("href"); // $NON-NLS-1$
12
           Node namedItem = nnm.getNamedItem("src"); // $NON-NLS-1$
12
			if (namedItem == null) {
13
           if (namedItem == null) {
13
				continue;
14
			}
15
			
14
               continue;
15
           }
16
String hrefStr = namedItem.getNodeValue();
16
           String hrefStr = namedItem.getNodeValue();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    String base = "";
    1
    String base = "";
    2
    NodeList baseList = html.getElementsByTagName("base");
    2
    NodeList baseList = html.getElementsByTagName("base");
    3
    if (baseList.getLength() > 0)
    3
    if (baseList.getLength() > 0)
    4
    base = baseList.item(0).getAttributes().getNamedItem("href").getNodeValue();
    4
    base = baseList.item(0).getAttributes().getNamedItem("href").getNodeValue();
    Precondition Violations (0)
    Row Violation