long start = 0, finish = 0; try { if (s_log.isDebugEnabled()) { s_log.debug(i18n.LOADING_PROCS_MSG); start = System.currentTimeMillis(); } int beginProgress = getLoadMethodProgress(progress++); setProgress(i18n.LOADING_PROCS_MSG, beginProgress); privateLoadStoredProcedures(catalog, schema, procNamePattern, i18n.LOADING_PROCS_MSG, beginProgress); if (s_log.isDebugEnabled()) { finish = System.currentTimeMillis(); s_log.debug("stored procedures loaded in " + (finish - start) + " ms"); } } catch (Exception ex) { s_log.error("Error loading stored procedures", ex); } return progress;
long start = 0, finish = 0; try { if (s_log.isDebugEnabled()) { s_log.debug(i18n.LOADING_CATALOGS_MSG); start = System.currentTimeMillis(); } int beginProgress = getLoadMethodProgress(progress++); setProgress(i18n.LOADING_CATALOGS_MSG, beginProgress); privateLoadCatalogs(); if (s_log.isDebugEnabled()) { finish = System.currentTimeMillis(); s_log.debug("Catalogs loaded in " + (finish - start) + " ms"); } } catch (Exception ex) { s_log.error("Error loading catalogs", ex); } return progress;
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/schemainfo/SchemaInfo.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/schemainfo/SchemaInfo.java
Method name: int loadStoredProcedures(String, String, String, int) Method name: int loadCatalogs(int)
Number of AST nodes: 12 Number of AST nodes: 12
1
long start = 0, finish = 0;
1
long start = 0, finish = 0;
2
      try
2
      try
3
      {
3
      {
4
         if (s_log.isDebugEnabled()) {
4
         if (s_log.isDebugEnabled()) {
5
             s_log.debug(i18n.LOADING_PROCS_MSG);
5
             s_log.debug(i18n.LOADING_CATALOGS_MSG);
6
             start = System.currentTimeMillis();
6
             start = System.currentTimeMillis();
7
         }
7
         }
8
         int beginProgress = getLoadMethodProgress(progress++);
8
         int beginProgress = getLoadMethodProgress(progress++);
9
         setProgress(i18n.LOADING_PROCS_MSG, beginProgress);
9
         setProgress(i18n.LOADING_CATALOGS_MSG, beginProgress);
10
         privateLoadStoredProcedures(catalog, 
10
         privateLoad
11
                                     schema, 
12
                                     procNamePattern, 
13
                                     i18n.LOADING_PROCS_MSG, 
14
                                     beginProgress);
11
Catalogs();
15
         if (s_log.isDebugEnabled()) {
12
         if (s_log.isDebugEnabled()) {
16
             finish = System.currentTimeMillis();
13
             finish = System.currentTimeMillis();
17
             s_log.debug("stored procedures loaded in " + (finish - start) + " ms");
14
             s_log.debug("Catalogs loaded in " + (finish - start) + " ms");
18
         }
15
         }
19
      }
16
      }
20
      catch (Exception ex)
17
      catch (Exception ex)
21
      {
18
      {
22
         s_log.error("Error loading stored procedures", ex);
19
         s_log.error("Error loading catalogs", ex);
23
      }
20
      }
24
      return progress;
21
      return progress;
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.6
Clones locationClones are declared in the same class
Number of node comparisons48
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)223.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    long start = 0, finish = 0;
    1
    long start = 0, finish = 0;
    2
    try
    2
    try
    2
    try
    Differences
    Expression1Expression2Difference
    "Error loading stored procedures""Error loading catalogs"LITERAL_VALUE_MISMATCH
    2
    try
    3
    if (s_log.isDebugEnabled())
    3
    if (s_log.isDebugEnabled())
    4
    s_log.debug(i18n.LOADING_PROCS_MSG);
    4
    s_log.debug(i18n.LOADING_PROCS_MSG);
    4
    s_log.debug(i18n.LOADING_CATALOGS_MSG);
    Differences
    Expression1Expression2Difference
    LOADING_PROCS_MSGLOADING_CATALOGS_MSGVARIABLE_NAME_MISMATCH
    4
    s_log.debug(i18n.LOADING_CATALOGS_MSG);
    5
    start = System.currentTimeMillis();
    5
    start = System.currentTimeMillis();
    6
    int beginProgress = getLoadMethodProgress(progress++);
    6
    int beginProgress = getLoadMethodProgress(progress++);
    7
    setProgress(i18n.LOADING_PROCS_MSG, beginProgress);
    7
    setProgress(i18n.LOADING_PROCS_MSG, beginProgress);
    7
    setProgress(i18n.LOADING_CATALOGS_MSG, beginProgress);
    Differences
    Expression1Expression2Difference
    LOADING_PROCS_MSGLOADING_CATALOGS_MSGVARIABLE_NAME_MISMATCH
    7
    setProgress(i18n.LOADING_CATALOGS_MSG, beginProgress);
    8
    privateLoadStoredProcedures(catalog, schema, procNamePattern, i18n.LOADING_PROCS_MSG, beginProgress);
    8
    privateLoadStoredProcedures(catalog, schema, procNamePattern, i18n.LOADING_PROCS_MSG, beginProgress);
    8
    privateLoadCatalogs();
    Differences
    Expression1Expression2Difference
    privateLoadStoredProceduresprivateLoadCatalogsMETHOD_INVOCATION_NAME_MISMATCH
    privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress)privateLoadCatalogs()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method privateLoadStoredProcedures
    Expression privateLoadCatalogs() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method privateLoadCatalogs
    Expression privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress) is a void method call, and thus it cannot be parameterized
    Expression privateLoadCatalogs() is a void method call, and thus it cannot be parameterized
    Expression privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method privateLoadStoredProcedures
    Expression privateLoadCatalogs() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method privateLoadCatalogs
    Expression privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress) is a void method call, and thus it cannot be parameterized
    Expression privateLoadCatalogs() is a void method call, and thus it cannot be parameterized
    8
    privateLoadCatalogs();
    9
    if (s_log.isDebugEnabled())
    9
    if (s_log.isDebugEnabled())
    10
    finish = System.currentTimeMillis();
    10
    finish = System.currentTimeMillis();
    11
    s_log.debug("stored procedures loaded in " + (finish - start) + " ms");
    11
    s_log.debug("stored procedures loaded in " + (finish - start) + " ms");
    11
    s_log.debug("Catalogs loaded in " + (finish - start) + " ms");
    Differences
    Expression1Expression2Difference
    "stored procedures loaded in ""Catalogs loaded in "LITERAL_VALUE_MISMATCH
    11
    s_log.debug("Catalogs loaded in " + (finish - start) + " ms");
    12
    return progress;
    12
    return progress;
    Precondition Violations (8)
    Row Violation
    1Expression privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression privateLoadCatalogs() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress) is a void method call, and thus it cannot be parameterized
    4Expression privateLoadCatalogs() is a void method call, and thus it cannot be parameterized
    5Expression privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression privateLoadCatalogs() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    7Expression privateLoadStoredProcedures(catalog,schema,procNamePattern,i18n.LOADING_PROCS_MSG,beginProgress) is a void method call, and thus it cannot be parameterized
    8Expression privateLoadCatalogs() is a void method call, and thus it cannot be parameterized