XMLBeanReader doc = new XMLBeanReader(); doc.load(new ApplicationFiles().getEditWhereColsFile()); Iterator it = doc.iterator(); if (it.hasNext()) { editWhereCols = (EditWhereCols) it.next(); editWhereCols.setApplication(this); }
XMLBeanReader doc = new XMLBeanReader(); doc.load(new ApplicationFiles().getCellImportExportSelectionsFile()); Iterator it = doc.iterator(); if (it.hasNext()) { saverInstance = (CellImportExportInfoSaver) it.next(); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/Application.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/Application.java
Method name: void loadEditWhereColsInfo() Method name: void loadCellImportExportInfo()
Number of AST nodes: 6 Number of AST nodes: 5
1
XMLBeanReader doc = new XMLBeanReader();
1
XMLBeanReader doc = new XMLBeanReader();
2
			doc.load(new ApplicationFiles().getEditWhereColsFile());
2
			doc.load(new ApplicationFiles().getCellImportExportSelectionsFile());
3
			Iterator it = doc.iterator();
3
			Iterator it = doc.iterator();
4
			if (it.hasNext())
4
			if (it.hasNext())
5
			{
5
			{
6
				editWhereCols = (EditWhereCols) it.next();
6
				
7
				editWhereCols.setApplication(this);
7
saverInstance = (CellImportExportInfoSaver) it.next();
8
			}
8
			}
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.4
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    2
    XMLBeanReader doc = new XMLBeanReader();
    3
    XMLBeanReader doc = new XMLBeanReader();
    3
    doc.load(new ApplicationFiles().getEditWhereColsFile());
    3
    doc.load(new ApplicationFiles().getEditWhereColsFile());
    4
    doc.load(new ApplicationFiles().getCellImportExportSelectionsFile());
    Differences
    Expression1Expression2Difference
    getEditWhereColsFilegetCellImportExportSelectionsFileMETHOD_INVOCATION_NAME_MISMATCH
    4
    doc.load(new ApplicationFiles().getCellImportExportSelectionsFile());
    4
    Iterator it = doc.iterator();
    5
    Iterator it = doc.iterator();
    5
    if (it.hasNext())
    6
    if (it.hasNext())
    6
    editWhereCols = (EditWhereCols)it.next();
    6
    editWhereCols = (EditWhereCols)it.next();
    Preondition Violations
    Unmatched statement editWhereCols=(EditWhereCols)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                        
                                                                                                                
    7
    saverInstance = (CellImportExportInfoSaver)it.next();
    Preondition Violations
    Unmatched statement saverInstance=(CellImportExportInfoSaver)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    saverInstance = (CellImportExportInfoSaver)it.next();
    7
    editWhereCols.setApplication(this);
    7
    editWhereCols.setApplication(this);
    Preondition Violations
    Unmatched statement editWhereCols.setApplication(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement editWhereCols.setApplication(this); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                
    Precondition Violations (4)
    Row Violation
    1Unmatched statement editWhereCols=(EditWhereCols)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement saverInstance=(CellImportExportInfoSaver)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement editWhereCols.setApplication(this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement editWhereCols.setApplication(this); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted