for(int j = 0; j < node.getChildCount(); j++) { DefaultMutableTreeNode node2 = (DefaultMutableTreeNode) node.getChildAt(j); path[2] = node2; bufferTree.getSelectionModel() .addSelectionPath( new TreePath(path)); }
for(int i = 0; i < resultTreeRoot.getChildCount(); i++) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) resultTreeRoot.getChildAt(i); resultTree.collapsePath(new TreePath(new Object[] { resultTreeRoot, node })); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/FilesChangedDialog.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/HyperSearchResults.java
Method name: void selectAll() Method name: void searchFailed()
Number of AST nodes: 4 Number of AST nodes: 3
1
for(int j = 0; j < node.getChildCount(); j++)
1
for(int i = 0; i < resultTreeRoot.getChildCount(); i++)
2
			{
2
		{
3
				DefaultMutableTreeNode node2 =
3
			DefaultMutableTreeNode node =
4
					(DefaultMutableTreeNode)
4
 (DefaultMutableTreeNode)
5
					node.getChildAt(j);
5
				resultTreeRoot.getChildAt(i);
6
				path[2] = node2;
6
			
7
				bufferTree.getSelectionModel()
8
					.addSelectionPath(
9
					new TreePath(path
7
resultTree.collapsePath(new TreePath(new Object[] {
10
));
8
				resultTreeRoot, node }));
11
			}
9
		}
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 having the same super class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    7
    for (int j = 0; j < node.getChildCount(); j++)
    7
    for (int j = 0; j < node.getChildCount(); j++)
    2
    for (int i = 0; i < resultTreeRoot.getChildCount(); i++)
    Differences
    Expression1Expression2Difference
    jiVARIABLE_NAME_MISMATCH
    jiVARIABLE_NAME_MISMATCH
    noderesultTreeRootVARIABLE_NAME_MISMATCH
    jiVARIABLE_NAME_MISMATCH
    2
    for (int i = 0; i < resultTreeRoot.getChildCount(); i++)
    8
    DefaultMutableTreeNode node2 = (DefaultMutableTreeNode)node.getChildAt(j);
    8
    DefaultMutableTreeNode node2 = (DefaultMutableTreeNode)node.getChildAt(j);
    3
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)resultTreeRoot.getChildAt(i);
    Differences
    Expression1Expression2Difference
    node2nodeVARIABLE_NAME_MISMATCH
    jiVARIABLE_NAME_MISMATCH
    noderesultTreeRootVARIABLE_NAME_MISMATCH
    3
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)resultTreeRoot.getChildAt(i);
                                                                                                                                                            
    4
    resultTree.collapsePath(new TreePath(new Object[] {resultTreeRoot, node}));
    Preondition Violations
    Unmatched statement resultTree.collapsePath(new TreePath(new Object[]{resultTreeRoot,node})); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    resultTree.collapsePath(new TreePath(new Object[] {resultTreeRoot, node}));
    9
    path[2] = node2;
    9
    path[2] = node2;
    Preondition Violations
    Unmatched statement path[2]=node2; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                      
    10
    bufferTree.getSelectionModel().addSelectionPath(new TreePath(path));
                                                                                                                                                    
    Precondition Violations (2)
    Row Violation
    1Unmatched statement resultTree.collapsePath(new TreePath(new Object[]{resultTreeRoot,node})); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement path[2]=node2; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted