if ( "from".equalsIgnoreCase( potentialTrimCharacter ) ) { trimCharacter = "' '"; trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 1 ); } else if ( potentialTrimCharacterArgIndex + 1 >= args.size() ) { trimCharacter = "' '"; trimSource = potentialTrimCharacter; } else { trimCharacter = potentialTrimCharacter; if ( "from".equalsIgnoreCase( ( String ) args.get( potentialTrimCharacterArgIndex + 1 ) ) ) { trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 2 ); } else { trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 1 ); } }
if ( "from".equalsIgnoreCase( potentialTrimCharacter ) ) { trimCharacter = "' '"; trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 1 ); } else if ( potentialTrimCharacterArgIndex + 1 >= args.size() ) { trimCharacter = "' '"; trimSource = potentialTrimCharacter; } else { trimCharacter = potentialTrimCharacter; if ( "from".equalsIgnoreCase( ( String ) args.get( potentialTrimCharacterArgIndex + 1 ) ) ) { trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 2 ); } else { trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 1 ); } }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/dialect/DerbyDialect.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/dialect/function/AbstractAnsiTrimEmulationFunction.java
Method name: String render(List, SessionFactoryImplementor) Method name: String render(List, SessionFactoryImplementor)
Number of AST nodes: 10 Number of AST nodes: 10
1
if ( "from".equalsIgnoreCase( potentialTrimCharacter ) ) {
1
if ( "from".equalsIgnoreCase( potentialTrimCharacter ) ) { 
2
					trimCharacter = "' '";
2
				trimCharacter = "' '";
3
					trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 1 );
3
				trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 1 );
4
				}
4
			}
5
				else if ( potentialTrimCharacterArgIndex + 1 >= args.size() ) {
5
			else if ( potentialTrimCharacterArgIndex + 1 >= args.size() ) {
6
					trimCharacter = "' '";
6
				trimCharacter = "' '";
7
					trimSource = potentialTrimCharacter;
7
				trimSource = potentialTrimCharacter;
8
				}
8
			}
9
				else {
9
			else {
10
					trimCharacter = potentialTrimCharacter;
10
				trimCharacter = potentialTrimCharacter;
11
					if ( "from".equalsIgnoreCase( ( String ) args.get( potentialTrimCharacterArgIndex + 1 ) ) ) {
11
				if ( "from".equalsIgnoreCase( ( String ) args.get( potentialTrimCharacterArgIndex + 1 ) ) ) {
12
						trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 2 );
12
					trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 2 );
13
					}
13
				}
14
					else {
14
				else {
15
						trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 1 );
15
					trimSource = ( String ) args.get( potentialTrimCharacterArgIndex + 1 );
16
					}
16
				}
17
				}
17
			}
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.8
Clones locationClones are in different classes
Number of node comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.6
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    18
    if ("from".equalsIgnoreCase(potentialTrimCharacter))
    18
    if ("from".equalsIgnoreCase(potentialTrimCharacter))
    19
    trimCharacter = "' '";
    19
    trimCharacter = "' '";
    20
    trimSource = (String)args.get(potentialTrimCharacterArgIndex + 1);
    20
    trimSource = (String)args.get(potentialTrimCharacterArgIndex + 1);
    21
    else if (potentialTrimCharacterArgIndex + 1 >= args.size())
    21
    else if (potentialTrimCharacterArgIndex + 1 >= args.size())
    22
    trimCharacter = "' '";
    22
    trimCharacter = "' '";
    23
    trimSource = potentialTrimCharacter;
    23
    trimSource = potentialTrimCharacter;
    else
    else
    24
    trimCharacter = potentialTrimCharacter;
    24
    trimCharacter = potentialTrimCharacter;
    25
    if ("from".equalsIgnoreCase((String)args.get(potentialTrimCharacterArgIndex + 1)))
    25
    if ("from".equalsIgnoreCase((String)args.get(potentialTrimCharacterArgIndex + 1)))
    26
    trimSource = (String)args.get(potentialTrimCharacterArgIndex + 2);
    26
    trimSource = (String)args.get(potentialTrimCharacterArgIndex + 2);
    else
    else
    27
    trimSource = (String)args.get(potentialTrimCharacterArgIndex + 1);
    27
    trimSource = (String)args.get(potentialTrimCharacterArgIndex + 1);
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables trimSource, trimCharacter , while Clone fragment #2 returns variables trimSource, trimCharacter