if (typeName.equals("Z") || typeName.equals("B") || typeName.equals("C") || typeName.equals("I") || typeName.equals("S")) { // boolean, byte, char, int, short code.addIload(i); } else if (typeName.equals("D")) { // double code.addDload(i); } else if (typeName.equals("F")) { // float code.addFload(i); } else if (typeName.equals("J")) { // long code.addLload(i); } else { // bad type throw new RuntimeException("bad type: " + typeName); }
if (typeName.equals("Z") || typeName.equals("B") || typeName.equals("C") || typeName.equals("I") || typeName.equals("S")) { // boolean, byte, char, int, short code.addIstore(i); } else if (typeName.equals("D")) { // double code.addDstore(i); } else if (typeName.equals("F")) { // float code.addFstore(i); } else if (typeName.equals("J")) { // long code.addLstore(i); } else { // bad type throw new RuntimeException("bad type: " + typeName); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/javassist/FieldTransformer.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/bytecode/javassist/FieldTransformer.java
Method name: void addTypeDependDataLoad(Bytecode, String, int) Method name: void addTypeDependDataStore(Bytecode, String, int)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (typeName.equals("Z") || typeName.equals("B")
1
if (typeName.equals("Z") || typeName.equals("B")
2
		           || typeName.equals("C") || typeName.equals("I")
2
		           || typeName.equals("C") || typeName.equals("I")
3
		           || typeName.equals("S")) {
3
		           || typeName.equals("S")) {
4
			// boolean, byte, char, int, short
4
			// boolean, byte, char, int, short
5
			code.addIload(i);
5
			code.addIstore(i);
6
		} else if (typeName.equals("D")) {
6
		} else if (typeName.equals("D")) {
7
			// double
7
			// double
8
			code.addDload(i);
8
			code.addDstore(i);
9
		} else if (typeName.equals("F")) {
9
		} else if (typeName.equals("F")) {
10
			// float
10
			// float
11
			code.addFload(i);
11
			code.addFstore(i);
12
		} else if (typeName.equals("J")) {
12
		} else if (typeName.equals("J")) {
13
			// long
13
			// long
14
			code.addLload(i);
14
			code.addLstore(i);
15
		} else {
15
		} else {
16
			// bad type
16
			// bad type
17
			throw new RuntimeException("bad type: " + typeName);
17
			throw new RuntimeException("bad type: " + typeName);
18
		}
18
		}
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)1.0
Clones locationClones are declared in the same class
Number of node comparisons57
  1. {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)3.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    else if (typeName.equals("Z") || typeName.equals("B") || typeName.equals("C") || typeName.equals("I") || typeName.equals("S"))
    3
    else if (typeName.equals("Z") || typeName.equals("B") || typeName.equals("C") || typeName.equals("I") || typeName.equals("S"))
    4
    code.addIload(i);
    4
    code.addIload(i);
    4
    code.addIstore(i);
    Differences
    Expression1Expression2Difference
    addIloadaddIstoreMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression code.addIload(i) is a void method call, and thus it cannot be parameterized
    Expression code.addIstore(i) is a void method call, and thus it cannot be parameterized
    4
    code.addIstore(i);
    5
    else if (typeName.equals("D"))
    5
    else if (typeName.equals("D"))
    6
    code.addDload(i);
    6
    code.addDload(i);
    6
    code.addDstore(i);
    Differences
    Expression1Expression2Difference
    addDloadaddDstoreMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression code.addDload(i) is a void method call, and thus it cannot be parameterized
    Expression code.addDstore(i) is a void method call, and thus it cannot be parameterized
    6
    code.addDstore(i);
    7
    else if (typeName.equals("F"))
    7
    else if (typeName.equals("F"))
    8
    code.addFload(i);
    8
    code.addFload(i);
    8
    code.addFstore(i);
    Differences
    Expression1Expression2Difference
    addFloadaddFstoreMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression code.addFload(i) is a void method call, and thus it cannot be parameterized
    Expression code.addFstore(i) is a void method call, and thus it cannot be parameterized
    8
    code.addFstore(i);
    9
    else if (typeName.equals("J"))
    9
    else if (typeName.equals("J"))
    10
    code.addLload(i);
    10
    code.addLload(i);
    10
    code.addLstore(i);
    Differences
    Expression1Expression2Difference
    addLloadaddLstoreMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression code.addLload(i) is a void method call, and thus it cannot be parameterized
    Expression code.addLstore(i) is a void method call, and thus it cannot be parameterized
    10
    code.addLstore(i);
    else
    else
    11
    throw new RuntimeException("bad type: " + typeName);
    11
    throw new RuntimeException("bad type: " + typeName);
    Precondition Violations (8)
    Row Violation
    1Expression code.addIload(i) is a void method call, and thus it cannot be parameterized
    2Expression code.addIstore(i) is a void method call, and thus it cannot be parameterized
    3Expression code.addDload(i) is a void method call, and thus it cannot be parameterized
    4Expression code.addDstore(i) is a void method call, and thus it cannot be parameterized
    5Expression code.addFload(i) is a void method call, and thus it cannot be parameterized
    6Expression code.addFstore(i) is a void method call, and thus it cannot be parameterized
    7Expression code.addLload(i) is a void method call, and thus it cannot be parameterized
    8Expression code.addLstore(i) is a void method call, and thus it cannot be parameterized