StringTemplate st = new StringTemplate(ST_ALTER_SEQUENCE_STYLE_TWO); OptionalSqlClause incClause = new OptionalSqlClause(DialectUtils.INCREMENT_BY_CLAUSE, increment); OptionalSqlClause minClause = new OptionalSqlClause(DialectUtils.MINVALUE_CLAUSE, minimum); OptionalSqlClause maxClause = new OptionalSqlClause(DialectUtils.MAXVALUE_CLAUSE, maximum); OptionalSqlClause cacheClause = new OptionalSqlClause(DialectUtils.CACHE_CLAUSE, cache); HashMap<String, String> valuesMap = DialectUtils.getValuesMap(ST_SEQUENCE_NAME_KEY, sequenceName, ST_INCREMENT_KEY, incClause, ST_MINIMUM_KEY, minClause, ST_MAXIMUM_KEY, maxClause, ST_CACHE_KEY, cacheClause); if (cycle) { valuesMap.put(ST_CYCLE_KEY, "CYCLE"); } return new String[] { DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs) };
StringTemplate st = new StringTemplate(ST_CREATE_SEQUENCE_STYLE_TWO); OptionalSqlClause incClause = new OptionalSqlClause(DialectUtils.INCREMENT_BY_CLAUSE, increment); OptionalSqlClause minClause = new OptionalSqlClause(DialectUtils.MINVALUE_CLAUSE, minimum); OptionalSqlClause maxClause = new OptionalSqlClause(DialectUtils.MAXVALUE_CLAUSE, maximum); OptionalSqlClause cacheClause = new OptionalSqlClause(DialectUtils.CACHE_CLAUSE, cache); HashMap<String, String> valuesMap = DialectUtils.getValuesMap(ST_SEQUENCE_NAME_KEY, sequenceName, ST_INCREMENT_KEY, incClause, ST_MINIMUM_KEY, minClause, ST_MAXIMUM_KEY, maxClause, ST_CACHE_KEY, cacheClause); if (cycle) { valuesMap.put(ST_CYCLE_KEY, "CYCLE"); } return DialectUtils.getCreateSequenceSQL(st, valuesMap, qualifier, prefs, this);
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/IngresDialectExt.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/IngresDialectExt.java
Method name: String[] getAlterSequenceSQL(String, String, String, String, String, String, boolean, DatabaseObjectQualifier, SqlGenerationPreferences) Method name: String getCreateSequenceSQL(String, String, String, String, String, String, boolean, DatabaseObjectQualifier, SqlGenerationPreferences)
Number of AST nodes: 9 Number of AST nodes: 9
1
StringTemplate st = new StringTemplate(ST_ALTER_SEQUENCE_STYLE_TWO);
1
StringTemplate st = new StringTemplate(ST_CREATE_SEQUENCE_STYLE_TWO);
2
		OptionalSqlClause incClause = new OptionalSqlClause(DialectUtils.INCREMENT_BY_CLAUSE, increment);
2
		OptionalSqlClause incClause = new OptionalSqlClause(DialectUtils.INCREMENT_BY_CLAUSE, increment);
3
		OptionalSqlClause minClause = new OptionalSqlClause(DialectUtils.MINVALUE_CLAUSE, minimum);
3
		OptionalSqlClause minClause = new OptionalSqlClause(DialectUtils.MINVALUE_CLAUSE, minimum);
4
		OptionalSqlClause maxClause = new OptionalSqlClause(DialectUtils.MAXVALUE_CLAUSE, maximum);
4
		OptionalSqlClause maxClause = new OptionalSqlClause(DialectUtils.MAXVALUE_CLAUSE, maximum);
5
		OptionalSqlClause cacheClause = new OptionalSqlClause(DialectUtils.CACHE_CLAUSE, cache);
5
		OptionalSqlClause cacheClause = new OptionalSqlClause(DialectUtils.CACHE_CLAUSE, cache);
6
		HashMap<String, String> valuesMap =
6
		HashMap<String, String> valuesMap =
7
			DialectUtils.getValuesMap(ST_SEQUENCE_NAME_KEY,
7
			DialectUtils.getValuesMap(ST_SEQUENCE_NAME_KEY,
8
				sequenceName,
8
				sequenceName,
9
				ST_INCREMENT_KEY,
9
				ST_INCREMENT_KEY,
10
				incClause,
10
				incClause,
11
				ST_MINIMUM_KEY,
11
				ST_MINIMUM_KEY,
12
				minClause,
12
				minClause,
13
				ST_MAXIMUM_KEY,
13
				ST_MAXIMUM_KEY,
14
				maxClause,
14
				maxClause,
15
				ST_CACHE_KEY,
15
				ST_CACHE_KEY,
16
				cacheClause);
16
				cacheClause);
17
		if (cycle)
17
		if (cycle)
18
		{
18
		{
19
			valuesMap.put(ST_CYCLE_KEY, "CYCLE");
19
			valuesMap.put(ST_CYCLE_KEY, "CYCLE");
20
		}
20
		}
21
		return new String[] { DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs) };
21
		return DialectUtils.getCreateSequenceSQL(st, valuesMap, qualifier, prefs, this);
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.1
Clones locationClones are declared in the same class
Number of node comparisons23
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    StringTemplate st = new StringTemplate(ST_ALTER_SEQUENCE_STYLE_TWO);
    1
    StringTemplate st = new StringTemplate(ST_ALTER_SEQUENCE_STYLE_TWO);
    1
    StringTemplate st = new StringTemplate(ST_CREATE_SEQUENCE_STYLE_TWO);
    Differences
    Expression1Expression2Difference
    ST_ALTER_SEQUENCE_STYLE_TWOST_CREATE_SEQUENCE_STYLE_TWOVARIABLE_NAME_MISMATCH
    1
    StringTemplate st = new StringTemplate(ST_CREATE_SEQUENCE_STYLE_TWO);
    2
    OptionalSqlClause incClause = new OptionalSqlClause(DialectUtils.INCREMENT_BY_CLAUSE, increment);
    2
    OptionalSqlClause incClause = new OptionalSqlClause(DialectUtils.INCREMENT_BY_CLAUSE, increment);
    3
    OptionalSqlClause minClause = new OptionalSqlClause(DialectUtils.MINVALUE_CLAUSE, minimum);
    3
    OptionalSqlClause minClause = new OptionalSqlClause(DialectUtils.MINVALUE_CLAUSE, minimum);
    4
    OptionalSqlClause maxClause = new OptionalSqlClause(DialectUtils.MAXVALUE_CLAUSE, maximum);
    4
    OptionalSqlClause maxClause = new OptionalSqlClause(DialectUtils.MAXVALUE_CLAUSE, maximum);
    5
    OptionalSqlClause cacheClause = new OptionalSqlClause(DialectUtils.CACHE_CLAUSE, cache);
    5
    OptionalSqlClause cacheClause = new OptionalSqlClause(DialectUtils.CACHE_CLAUSE, cache);
    6
    HashMap<String, String> valuesMap = DialectUtils.getValuesMap(ST_SEQUENCE_NAME_KEY, sequenceName, ST_INCREMENT_KEY, incClause, ST_MINIMUM_KEY, minClause, ST_MAXIMUM_KEY, maxClause, ST_CACHE_KEY, cacheClause);
    6
    HashMap<String, String> valuesMap = DialectUtils.getValuesMap(ST_SEQUENCE_NAME_KEY, sequenceName, ST_INCREMENT_KEY, incClause, ST_MINIMUM_KEY, minClause, ST_MAXIMUM_KEY, maxClause, ST_CACHE_KEY, cacheClause);
    7
    if (cycle)
    7
    if (cycle)
    8
    valuesMap.put(ST_CYCLE_KEY, "CYCLE");
    8
    valuesMap.put(ST_CYCLE_KEY, "CYCLE");
                                                                                                                                                                  
    9
    return DialectUtils.getCreateSequenceSQL(st, valuesMap, qualifier, prefs, this);
    Preondition Violations
    Unmatched statement return DialectUtils.getCreateSequenceSQL(st,valuesMap,qualifier,prefs,this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return DialectUtils.getCreateSequenceSQL(st,valuesMap,qualifier,prefs,this);
    9
    return DialectUtils.getCreateSequenceSQL(st, valuesMap, qualifier, prefs, this);
    9
    return new String[] {DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs)};
    9
    return new String[] {DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs)};
    Preondition Violations
    Unmatched statement return new String[]{DialectUtils.bindTemplateAttributes(this,st,valuesMap,qualifier,prefs)}; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return new String[]{DialectUtils.bindTemplateAttributes(this,st,valuesMap,qualifier,prefs)};
                                                                                                                                                                                                  
    Precondition Violations (5)
    Row Violation
    1Unmatched statement return DialectUtils.getCreateSequenceSQL(st,valuesMap,qualifier,prefs,this); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return DialectUtils.getCreateSequenceSQL(st,valuesMap,qualifier,prefs,this);
    3Unmatched statement return new String[]{DialectUtils.bindTemplateAttributes(this,st,valuesMap,qualifier,prefs)}; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return new String[]{DialectUtils.bindTemplateAttributes(this,st,valuesMap,qualifier,prefs)};
    5Clone fragment #1 returns variables st, valuesMap , while Clone fragment #2 returns variables st, valuesMap