if (next.startsWith(procSep)) { inMultiSQLStatement = false; if (collector != null) { tmp.add(collector.toString()); collector = null; } else { if (skipStraySep) { // Stray sep - or we failed to find pattern if (s_log.isDebugEnabled()) { s_log.debug( "Detected stray proc separator("+procSep+"). Skipping"); } } else { tmp.add(next); } } continue; }
inMultiSQLStatement = false; if (collector != null) { tmp.add(collector.toString()); collector = null; } else { if (skipStraySlash) { // Stray sep - or we failed to find pattern if (s_log.isDebugEnabled()) { s_log.debug("Detected stray proc separator(" + sep + "). Skipping"); } } else { tmp.add(next); } } continue;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/mysql/src/net/sourceforge/squirrel_sql/plugins/mysql/tokenizer/MysqlQueryTokenizer.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tokenizer/OracleQueryTokenizer.java
Method name: void joinFragments(Pattern, boolean) Method name: void joinFragments(Pattern, boolean)
Number of AST nodes: 10 Number of AST nodes: 9
1
if (next.startsWith(procSep)) {
2
                inMultiSQLStatement = false;
1
inMultiSQLStatement = false;
3
                if (collector != null) {
2
				if (collector != null)
4
                    
3
				{
5
tmp.add(collector.toString());
4
					tmp.add(collector.toString());
6
                    collector = null;
5
					collector = null;
7
                } else {
8
                    if (skipStraySep) {
9
                        
6
				} else
7
				{
8
					if (skipStraySlash)
9
					{
10
// Stray sep - or we failed to find pattern
10
						// Stray sep - or we failed to find pattern
11
                        if (s_log.isDebugEnabled()) {
11
						if (s_log.isDebugEnabled())
12
                            s_log.debug(
13
                                
12
						{
14
"Detected stray proc separator("+procSep+"). Skipping");
13
							s_log.debug("Detected stray proc separator(" + sep + "). Skipping");
15
                        }
16
                    } else {
17
                        tmp.add(next);
18
                    }
19
                }
20
                continue;
21
            }
14
						}
15
					} else
16
					{
17
						tmp.add(next);
18
					}
19
				}
20
				continue;
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 different classes having the same super class
Number of node comparisons23
  1. {Non-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)10.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    19
    inMultiSQLStatement = false;
    13
    inMultiSQLStatement = false;
    20
    if (collector != null)
    20
    if (collector != null)
    14
    if (collector != null)
    Differences
    Expression1Expression2Difference
    java.lang.StringBuilderjava.lang.StringBufferSUBCLASS_TYPE_MISMATCH
    14
    if (collector != null)
    21
    tmp.add(collector.toString());
    21
    tmp.add(collector.toString());
    15
    tmp.add(collector.toString());
    Differences
    Expression1Expression2Difference
    java.lang.StringBuilderjava.lang.StringBufferSUBCLASS_TYPE_MISMATCH
    15
    tmp.add(collector.toString());
    22
    collector = null;
    22
    collector = null;
    16
    collector = null;
    Differences
    Expression1Expression2Difference
    java.lang.StringBuilderjava.lang.StringBufferSUBCLASS_TYPE_MISMATCH
    16
    collector = null;
    else
    else
    23
    if (skipStraySep)
    23
    if (skipStraySep)
    17
    if (skipStraySlash)
    Differences
    Expression1Expression2Difference
    skipStraySepskipStraySlashVARIABLE_NAME_MISMATCH
    17
    if (skipStraySlash)
    24
    if (s_log.isDebugEnabled())
    18
    if (s_log.isDebugEnabled())
    25
    s_log.debug("Detected stray proc separator(" + procSep + "). Skipping");
    25
    s_log.debug("Detected stray proc separator(" + procSep + "). Skipping");
    19
    s_log.debug("Detected stray proc separator(" + sep + "). Skipping");
    Differences
    Expression1Expression2Difference
    procSepsepVARIABLE_NAME_MISMATCH
    19
    s_log.debug("Detected stray proc separator(" + sep + "). Skipping");
    else
    else
    26
    tmp.add(next);
    20
    tmp.add(next);
    27
    continue;
    27
    continue;
    21
    continue;
    Preondition Violations
    Statement continue; without innermost loop
    Statement continue; without innermost loop
    21
    continue;
    Precondition Violations (3)
    Row Violation
    1Statement continue; without innermost loop
    2Statement continue; without innermost loop
    3Clone fragment #1 returns variables inMultiSQLStatement, collector , while Clone fragment #2 returns variables inMultiSQLStatement, collector