TaskThreadPool result = createMock(TaskThreadPool.class); result.addTask(isA(Runnable.class)); expectLastCall().anyTimes(); replay(result); return result;
SessionManager result = createMock(SessionManager.class); result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class)); expectLastCall().anyTimes(); replay(result); return result;
Clone fragments detected by clone detection tool
File path: /sql12/test/src/net/sourceforge/squirrel_sql/test/TestUtil.java File path: /sql12/test/src/net/sourceforge/squirrel_sql/test/TestUtil.java
Method name: TaskThreadPool getEasyMockTaskThreadPool() Method name: SessionManager getEasyMockSessionManager()
Number of AST nodes: 5 Number of AST nodes: 5
1
TaskThreadPool result = createMock(TaskThreadPool.class);
1
SessionManager result = createMock(SessionManager.class);
2
      result.addTask(isA(Runnable.class));
2
      result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class));
3
      expectLastCall().anyTimes();
3
      expectLastCall().anyTimes();
4
      replay(result);
4
      replay(result);
5
      return result;
5
      return result;
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.0
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                        
    1
    SessionManager result = createMock(SessionManager.class);
    1
    TaskThreadPool result = createMock(TaskThreadPool.class);
                                                                                                                        
    2
    result.addTask(isA(Runnable.class));
    2
    result.addTask(isA(Runnable.class));
    2
    result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class));
    Differences
    Expression1Expression2Difference
    Runnable.classIAllowedSchemaChecker.classLITERAL_VALUE_MISMATCH
    java.lang.Runnablenet.sourceforge.squirrel_sql.client.session.IAllowedSchemaCheckerVARIABLE_TYPE_MISMATCH
    addTaskaddAllowedSchemaCheckerMETHOD_INVOCATION_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.util.TaskThreadPoolnet.sourceforge.squirrel_sql.client.session.SessionManagerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Runnable of variable isA(Runnable.class) does not match with type net.sourceforge.squirrel_sql.client.session.IAllowedSchemaChecker of variable isA(IAllowedSchemaChecker.class)
    • Make classes java.lang.Runnable and net.sourceforge.squirrel_sql.client.session.IAllowedSchemaChecker extend a common superclass
    Expression result.addTask(isA(Runnable.class)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression result.addTask(isA(Runnable.class)) is a void method call, and thus it cannot be parameterized
    Expression result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class)) is a void method call, and thus it cannot be parameterized
    Type net.sourceforge.squirrel_sql.fw.util.TaskThreadPool of variable result does not match with type net.sourceforge.squirrel_sql.client.session.SessionManager of variable result
    • Make classes net.sourceforge.squirrel_sql.fw.util.TaskThreadPool and net.sourceforge.squirrel_sql.client.session.SessionManager extend a common superclass
    2
    result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class));
    3
    expectLastCall().anyTimes();
    3
    expectLastCall().anyTimes();
    4
    replay(result);
    4
    replay(result);
    4
    replay(result);
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.fw.util.TaskThreadPoolnet.sourceforge.squirrel_sql.client.session.SessionManagerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.fw.util.TaskThreadPool of variable result does not match with type net.sourceforge.squirrel_sql.client.session.SessionManager of variable result
    • Make classes net.sourceforge.squirrel_sql.fw.util.TaskThreadPool and net.sourceforge.squirrel_sql.client.session.SessionManager extend a common superclass
    4
    replay(result);
                                      
    5
    return result;
    Preondition Violations
    Unmatched return result;
    5
    return result;
    5
    return result;
                                      
    Precondition Violations (8)
    Row Violation
    1Type java.lang.Runnable of variable isA(Runnable.class) does not match with type net.sourceforge.squirrel_sql.client.session.IAllowedSchemaChecker of variable isA(IAllowedSchemaChecker.class)
    2Expression result.addTask(isA(Runnable.class)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression result.addTask(isA(Runnable.class)) is a void method call, and thus it cannot be parameterized
    5Expression result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class)) is a void method call, and thus it cannot be parameterized
    6Type net.sourceforge.squirrel_sql.fw.util.TaskThreadPool of variable result does not match with type net.sourceforge.squirrel_sql.client.session.SessionManager of variable result
    7Type net.sourceforge.squirrel_sql.fw.util.TaskThreadPool of variable result does not match with type net.sourceforge.squirrel_sql.client.session.SessionManager of variable result
    8Unmatched return result;