if (times != 0) { expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_REMOVE_STARTED)).andReturn( mockFileRemoveStartedStatusEvent); expectLastCall().times(times); expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_REMOVE_COMPLETE)).andReturn( mockFileRemoveCompleteStatusEvent); expectLastCall().times(times); mockInstallStatusListener.handleInstallStatusEvent(mockFileRemoveStartedStatusEvent); expectLastCall().times(times); mockInstallStatusListener.handleInstallStatusEvent(mockFileRemoveCompleteStatusEvent); expectLastCall().times(times); }
if (times != 0) { expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_INSTALL_STARTED)).andReturn( mockFileInstallStartedStatusEvent); expectLastCall().times(times); mockInstallStatusListener.handleInstallStatusEvent(mockFileInstallStartedStatusEvent); expectLastCall().times(times); expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_INSTALL_COMPLETE)).andReturn( mockFileInstallCompleteStatusEvent); expectLastCall().times(times); mockInstallStatusListener.handleInstallStatusEvent(mockFileInstallCompleteStatusEvent); expectLastCall().times(times); }
Clone fragments detected by clone detection tool
File path: /sql12/test/src/net/sourceforge/squirrel_sql/client/update/gui/installer/ArtifactInstallerImplTest.java File path: /sql12/test/src/net/sourceforge/squirrel_sql/client/update/gui/installer/ArtifactInstallerImplTest.java
Method name: void setupRemoveStatusEventExpectations(int) Method name: void setupInstallEventsAndListener(int)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (times != 0)
1
if (times != 0)
2
		{
2
		{
3
			expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_REMOVE_STARTED)).andReturn(
3
			expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_INSTALL_STARTED)).andReturn(
4
				mockFileRemoveStartedStatusEvent);
4
				mockFileInstallStartedStatusEvent);
5
			expectLastCall().times(times);
5
			expectLastCall().times(times);
6
			expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_REMOVE_COMPLETE)).andReturn(
6
			mockInstallStatus
7
				mockFileRemoveCompleteStatusEvent);
7
Listener.handleInstallStatusEvent(mockFileInstallStartedStatusEvent);
8
			expectLastCall().times(times);
8
			expectLastCall().times(times);
9
			mockInstallStatusListener.handleInstallStatusEvent(mockFileRemoveStar
9
			expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_INSTALL_COMPLETE)).andReturn(
10
tedStatusEvent);
10
				mockFileInstallCompleteStatusEvent);
11
			expectLastCall().times(times);
11
			expectLastCall().times(times);
12
			mockInstallStatusListener.handleInstallStatusEvent(mockFileRemoveCompleteStatusEvent);
12
			mockInstallStatusListener.handleInstallStatusEvent(mockFileInstallCompleteStatusEvent);
13
			expectLastCall().times(times);
13
			expectLastCall().times(times);
14
		}
14
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons81
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)12.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (times != 0)
    4
    if (times != 0)
    7
    expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_REMOVE_STARTED)).andReturn(mockFileRemoveStartedStatusEvent);
    7
    expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_REMOVE_STARTED)).andReturn(mockFileRemoveStartedStatusEvent);
    5
    expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_INSTALL_STARTED)).andReturn(mockFileInstallStartedStatusEvent);
    Differences
    Expression1Expression2Difference
    mockFileRemoveStartedStatusEventmockFileInstallStartedStatusEventVARIABLE_NAME_MISMATCH
    FILE_REMOVE_STARTEDFILE_INSTALL_STARTEDVARIABLE_NAME_MISMATCH
    5
    expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_INSTALL_STARTED)).andReturn(mockFileInstallStartedStatusEvent);
    8
    expectLastCall().times(times);
    6
    expectLastCall().times(times);
    9
    expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_REMOVE_COMPLETE)).andReturn(mockFileRemoveCompleteStatusEvent);
    9
    expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_REMOVE_COMPLETE)).andReturn(mockFileRemoveCompleteStatusEvent);
    9
    expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_INSTALL_COMPLETE)).andReturn(mockFileInstallCompleteStatusEvent);
    Differences
    Expression1Expression2Difference
    mockFileRemoveCompleteStatusEventmockFileInstallCompleteStatusEventVARIABLE_NAME_MISMATCH
    FILE_REMOVE_COMPLETEFILE_INSTALL_COMPLETEVARIABLE_NAME_MISMATCH
    9
    expect(mockInstallStatusEventFactory.create(InstallEventType.FILE_INSTALL_COMPLETE)).andReturn(mockFileInstallCompleteStatusEvent);
    10
    expectLastCall().times(times);
    8
    expectLastCall().times(times);
    11
    mockInstallStatusListener.handleInstallStatusEvent(mockFileRemoveStartedStatusEvent);
    11
    mockInstallStatusListener.handleInstallStatusEvent(mockFileRemoveStartedStatusEvent);
    7
    mockInstallStatusListener.handleInstallStatusEvent(mockFileInstallStartedStatusEvent);
    Differences
    Expression1Expression2Difference
    mockFileRemoveStartedStatusEventmockFileInstallStartedStatusEventVARIABLE_NAME_MISMATCH
    7
    mockInstallStatusListener.handleInstallStatusEvent(mockFileInstallStartedStatusEvent);
    12
    expectLastCall().times(times);
    10
    expectLastCall().times(times);
    13
    mockInstallStatusListener.handleInstallStatusEvent(mockFileRemoveCompleteStatusEvent);
    13
    mockInstallStatusListener.handleInstallStatusEvent(mockFileRemoveCompleteStatusEvent);
    11
    mockInstallStatusListener.handleInstallStatusEvent(mockFileInstallCompleteStatusEvent);
    Differences
    Expression1Expression2Difference
    mockFileRemoveCompleteStatusEventmockFileInstallCompleteStatusEventVARIABLE_NAME_MISMATCH
    11
    mockInstallStatusListener.handleInstallStatusEvent(mockFileInstallCompleteStatusEvent);
    14
    expectLastCall().times(times);
    12
    expectLastCall().times(times);
    Precondition Violations (0)
    Row Violation