for (ArtifactStatus status : _artifacts) { if (status.isPluginArtifact()) { status.setArtifactAction(ArtifactAction.INSTALL); } } _model.fireTableDataChanged();
for (ArtifactStatus status : _artifacts) { if (status.isTranslationArtifact()) { status.setArtifactAction(ArtifactAction.INSTALL); } } _model.fireTableDataChanged();
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/update/gui/UpdateSummaryTable.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (ArtifactStatus status : _artifacts) {
1
for (ArtifactStatus status : _artifacts) {
2
               if (status.isPluginArtifact()) {
2
               if (status.isTranslationArtifact()) {
3
                  status.setArtifactAction(ArtifactAction.INSTALL);
3
                  status.setArtifactAction(ArtifactAction.INSTALL);
4
               }
4
               }
5
            }
5
            }
6
            _model.fireTableDataChanged();
6
            _model.fireTableDataChanged();
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.5
Clones locationClones are in the same java file
Number of node comparisons6
  1. {Non-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)5.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (ArtifactStatus status : _artifacts)
    1
    for (ArtifactStatus status : _artifacts)
    1
    for (ArtifactStatus status : _artifacts)
    Differences
    Expression1Expression2Difference
    isPluginArtifactisTranslationArtifactMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression status.isPluginArtifact() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression status.isTranslationArtifact() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    for (ArtifactStatus status : _artifacts)
    2
    if (status.isPluginArtifact())
    2
    if (status.isPluginArtifact())
    2
    if (status.isTranslationArtifact())
    Differences
    Expression1Expression2Difference
    isPluginArtifactisTranslationArtifactMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression status.isPluginArtifact() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression status.isTranslationArtifact() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    if (status.isTranslationArtifact())
    3
    status.setArtifactAction(ArtifactAction.INSTALL);
    3
    status.setArtifactAction(ArtifactAction.INSTALL);
    4
    _model.fireTableDataChanged();
    4
    _model.fireTableDataChanged();
    Precondition Violations (5)
    Row Violation
    1Expression status.isPluginArtifact() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression status.isTranslationArtifact() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression status.isPluginArtifact() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression status.isTranslationArtifact() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5The refactoring of the clones is infeasible, because classes and do not have a common superclass