while (i.hasNext()) { ArtifactStatus status = i.next(); if (status.isInstalled()) { status.setArtifactAction(ArtifactAction.INSTALL); } }
for (Iterator<ISQLDriver> iter = tmp.getAllForClass(SQL_DRIVER_IMPL); iter.hasNext();) { ISQLDriver defaultDriver = iter.next(); if (!containsDriver(defaultDriver)) { missingDrivers.add(defaultDriver); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/UpdateSummaryTable.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/DataCache.java
Method name: void setReleaseVersionWillChange(boolean) Method name: ISQLDriver[] findMissingDefaultDrivers(URL)
Number of AST nodes: 4 Number of AST nodes: 4
1
while (i.hasNext()) {
1
for (Iterator<ISQLDriver> iter = tmp.getAllForClass(SQL_DRIVER_IMPL); iter.hasNext();) {
2
				ArtifactStatus status = i.next();
2
                ISQLDriver defaultDriver = iter.next();
3
				if (status.isInstalled()) {
4
					status.setArtifactAction(ArtifactAction.INSTALL);
5
				}
6
			
3
                if (!containsDriver(defaultDriver)) {
4
                    missingDrivers.add(defaultDriver);
5
                }
7
}
6
            }
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 in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)17.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    ArtifactStatus status = i.next();
    5
    ArtifactStatus status = i.next();
    Preondition Violations
    Unmatched statement ArtifactStatus status=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
                                                                                    
    8
    ISQLDriver defaultDriver = iter.next();
    Preondition Violations
    Unmatched statement ISQLDriver defaultDriver=iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    ISQLDriver defaultDriver = iter.next();
    6
    if (status.isInstalled())
    6
    if (status.isInstalled())
    9
    if (!containsDriver(defaultDriver))
    Differences
    Expression1Expression2Difference
    status.isInstalled()!containsDriver(defaultDriver)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression status.isInstalled() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression !containsDriver(defaultDriver) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    if (!containsDriver(defaultDriver))
    7
    status.setArtifactAction(ArtifactAction.INSTALL);
    7
    status.setArtifactAction(ArtifactAction.INSTALL);
    Preondition Violations
    Unmatched statement status.setArtifactAction(ArtifactAction.INSTALL); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                            
                                                                                
    10
    missingDrivers.add(defaultDriver);
    Preondition Violations
    Unmatched statement missingDrivers.add(defaultDriver); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10
    missingDrivers.add(defaultDriver);
    Precondition Violations (7)
    Row Violation
    1Unmatched statement ArtifactStatus status=i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement ISQLDriver defaultDriver=iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression status.isInstalled() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression !containsDriver(defaultDriver) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement status.setArtifactAction(ArtifactAction.INSTALL); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement missingDrivers.add(defaultDriver); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero