for(int j = 0; j < node.getChildCount(); j++) { DefaultMutableTreeNode node2 = (DefaultMutableTreeNode) node.getChildAt(j); path[2] = node2; bufferTree.getSelectionModel() .addSelectionPath( new TreePath(path)); }
String path = file.getPath(); String[] children = file.list(); for(int i = 0; i < children.length; i++) { ok &= deleteRecursively(new File(path,children[i])); }
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/pluginmgr/Roster.java
Method name: void selectAll() Method name: boolean deleteRecursively(File)
Number of AST nodes: 4 Number of AST nodes: 4
1
for(int j = 0; j < node.getChildCount(); j++)
2
			{
3
				DefaultMutableTreeNode node2 =
4
					(DefaultMutableTreeNode)
5
					node.getChildA
1
String path = file.getPath();
6
t(j);
2
				String[] children = file.list();
7
				path[2] = node2;
3
				
8
				bufferTree.getSelectionModel()
9
					.addSelectionPath(
10
					new TreePath(path
4
for(int i = 0; i < children.length; i++)
5
				{
11
));
6
					ok &= deleteRecursively(new File(path,children[i]));
12
			}
7
				}
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
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                
    4
    String path = file.getPath();
                                                                      
    5
    String[] children = file.list();
    7
    for (int j = 0; j < node.getChildCount(); j++)
    7
    for (int j = 0; j < node.getChildCount(); j++)
    6
    for (int i = 0; i < children.length; i++)
    Differences
    Expression1Expression2Difference
    jiVARIABLE_NAME_MISMATCH
    jiVARIABLE_NAME_MISMATCH
    node.getChildCount()children.lengthTYPE_COMPATIBLE_REPLACEMENT
    jiVARIABLE_NAME_MISMATCH
    6
    for (int i = 0; i < children.length; i++)
                                                                                                              
    7
    ok &= deleteRecursively(new File(path, children[i]));
    Preondition Violations
    Unmatched statement ok&=deleteRecursively(new File(path,children[i])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    ok &= deleteRecursively(new File(path, children[i]));
    8
    DefaultMutableTreeNode node2 = (DefaultMutableTreeNode)node.getChildAt(j);
    8
    DefaultMutableTreeNode node2 = (DefaultMutableTreeNode)node.getChildAt(j);
    Preondition Violations
    Unmatched statement DefaultMutableTreeNode node2=(DefaultMutableTreeNode)node.getChildAt(j); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                          
    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 (3)
    Row Violation
    1Unmatched statement ok&=deleteRecursively(new File(path,children[i])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement DefaultMutableTreeNode node2=(DefaultMutableTreeNode)node.getChildAt(j); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement path[2]=node2; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted